From dc1803ad887f4e4aac5f3638e773945ee6ffed61 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Tue, 7 Feb 2017 17:44:39 +0700 Subject: [PATCH] Get module name from package.json --- package.json | 1 + rollup.config.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e3fba59..3e6ea83 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "babel-plugin-array-includes": "^2.0.3", "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", "browser-env": "^2.0.19", + "camelcase": "^4.0.0", "coveralls": "^2.11.15", "jsdom": "^9.9.1", "nyc": "^10.0.0", diff --git a/rollup.config.js b/rollup.config.js index 3894836..53ae9a7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,5 @@ import babel from 'rollup-plugin-babel'; +import camelCase from 'camelcase'; const pkg = require('./package.json'); @@ -11,7 +12,7 @@ export default { { dest: pkg.main, format: 'umd', - moduleName: 'whenDomReady', + moduleName: camelCase(pkg.name), sourceMap: true }, {