Skip to content

Commit

Permalink
Added webpack.config.vendorBundle to disable creation of a vendor bundle
Browse files Browse the repository at this point in the history
Closes #106
  • Loading branch information
insin committed May 27, 2016
1 parent 9b3175b commit 5fe4a9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
**Added:**

- Added `webpack.postcss` config to customise the PostCSS plugins applied to each style pipeline.
- Added `webpack.plugins.vendorBundle` to disable extracting anything imported from `node_modules/` into a separate `vendor` bundle.

**Changed:**

Expand Down
5 changes: 5 additions & 0 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The object exported or returned by your nwb config can use the following fields:
* [`webpack.plugins`](#plugins-object)
* [`plugins.define`](#pluginsdefine-object)
* [`plugins.install`](#pluginsinstall-object)
* [`plugins.vendorBundle`](#pluginsvendorbundle-boolean)
* [`webpack.extra`](#extra-object)
* Karma Configuration
* [`karma`](#karma-object)
Expand Down Expand Up @@ -270,6 +271,10 @@ The default options used by nwb are:
}
```
###### `plugins.vendorBundle`: `Boolean`
Setting this to `false` disables extraction of anything imported from `node_modules/` into a `vendor` bundle.
##### `postcss`: `Object`
By default, nwb configures the `postcss-loader` in each style pipeline to automatically add vendor prefixes to CSS rules.
Expand Down
2 changes: 1 addition & 1 deletion src/createWebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export function createPlugins(server, buildConfig = {}, userConfig = {}) {
}))

// Move modules imported from node_modules into a vendor chunk
if (vendorChunkName) {
if (userConfig.vendorBundle !== false && vendorChunkName) {
plugins.push(new optimize.CommonsChunkPlugin({
name: vendorChunkName,
minChunks(module, count) {
Expand Down

0 comments on commit 5fe4a9f

Please sign in to comment.