From 06b943104525fa4b8a14a1d124c27a4caa9e8cac Mon Sep 17 00:00:00 2001 From: Kai Johnson Date: Mon, 1 May 2017 20:31:19 -0400 Subject: [PATCH] Npm umd packages (#89) * Add umd packages to npm repo via prepublish hook. * Don't bundle angular and angular-ui-router within the umd package. --- package.json | 4 ++-- webpack.config.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 webpack.config.js diff --git a/package.json b/package.json index cdfc774..608e0da 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "test": "npm run lint; NODE_ENV=test node node_modules/.bin/mocha --compilers js:babel-register --recursive --require src/__tests__/index.js src/**/*.test.js", "test:live": "npm run lint; NODE_ENV=test node node_modules/.bin/mocha --compilers js:babel-register --recursive --require src/__tests__/index.js -w src/**/*.test.js", "build": "npm run clean; npm run test; node node_modules/.bin/babel src --out-dir lib", - "bundle:dev": "webpack --output-library=ngReduxUiRouter --output-library-target=umd lib/index.js dist/redux-ui-router.js", - "bundle:prod": "webpack -p --output-library=ngReduxUiRouter --output-library-target=umd lib/index.js dist/redux-ui-router.min.js", + "bundle:dev": "webpack lib/index.js dist/redux-ui-router.js", + "bundle:prod": "webpack -p lib/index.js dist/redux-ui-router.min.js", "prepublish": "npm run build && npm run bundle:dev && npm run bundle:prod" }, "repository": { diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..170d906 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,7 @@ +module.exports = { + output: { + library: 'ngReduxUiRouter', + libraryTarget: 'umd' + }, + externals: ['angular', 'angular-ui-router'] +};