Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit a6fcf2a

Browse files
fix(deps): include dependencies in bundle
1 parent dc02936 commit a6fcf2a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test-watch": "karma start --singleRun=false --autoWatch=true",
88
"commit": "npm run prepublish && npm test && git-cz",
99
"prepublish": "ngc && npm run build",
10-
"build": "webpack && cp bundles/angular-provide-once.umd.js bundles/index.js",
10+
"build": "webpack && cp bundles/main.umd.js bundles/index.js",
1111
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
1212
},
1313
"repository": {

webpack.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ module.exports = {
2424
output: {
2525
path: helpers.root('bundles'),
2626
publicPath: '/',
27-
filename: 'angular-provide-once.umd.js',
27+
filename: '[name].umd.js',
2828
libraryTarget: 'umd',
2929
library: 'angular-provide-once'
3030
},
3131

3232
// require those dependencies but don't bundle them
33-
externals: [/^\@angular\//, /^rxjs\//],
33+
externals: [/^angular\//, /^rxjs\//],
3434

3535
module: {
3636
rules: [{
@@ -59,6 +59,14 @@ module.exports = {
5959
failOnHint: false
6060
}
6161
}
62+
}),
63+
64+
new webpack.optimize.CommonsChunkPlugin({
65+
name: 'vendor',
66+
minChunks: function (module) {
67+
// this assumes your vendor imports exist in the node_modules directory
68+
return module.context && module.context.indexOf('node_modules') !== -1;
69+
}
6270
})
6371
]
6472
};

0 commit comments

Comments
 (0)