Skip to content

Commit

Permalink
Add note regarding webpack.config.preset.js usage
Browse files Browse the repository at this point in the history
See #2119
  • Loading branch information
knowler committed Oct 19, 2018
1 parent a33bbe5 commit 37c7e0d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/assets/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ if (config.enabled.watcher) {
webpackConfig = merge(webpackConfig, require('./webpack.config.watch'));
}

/**
* During installation via sage-installer (i.e. composer create-project) some
* presets may generate a preset specific config (webpack.config.preset.js) to
* override some of the default options set here. We use webpack-merge to merge
* them in. If you need to modify Sage's default webpack config, we recommend
* that you modify this file directly, instead of creating your own preset
* file, as there are limitations to using webpack-merge which can hinder your
* ability to change certain options.
*/
module.exports = merge.smartStrategy({
'module.loaders': 'replace',
})(webpackConfig, desire(`${__dirname}/webpack.config.preset`));

0 comments on commit 37c7e0d

Please sign in to comment.