Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add hooks for overrides
  • Loading branch information
yanglinz committed Dec 23, 2016
commit ad033eb482e50ac6cbdb4417db5ef19df8d1929d
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ template/src/__tests__/__snapshots__/
lerna-debug.log
npm-debug.log
/.changelog
.idea
4 changes: 2 additions & 2 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var env = getClientEnvironment(publicUrl);
// This is the development configuration.
// It is focused on developer experience and fast rebuilds.
// The production configuration is different and lives in a separate file.
module.exports = {
module.exports = require('./webpack.config.dev.override')({
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.
devtool: 'cheap-module-source-map',
Expand Down Expand Up @@ -235,4 +235,4 @@ module.exports = {
net: 'empty',
tls: 'empty'
}
};
});
5 changes: 5 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.override.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function devConfigOverride(config) {
return config;
}

module.exports = devConfigOverride;
4 changes: 2 additions & 2 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (env['process.env'].NODE_ENV !== '"production"') {
// This is the production configuration.
// It compiles slowly and is focused on producing a fast and minimal bundle.
// The development configuration is different and lives in a separate file.
module.exports = {
module.exports = require('./webpack.config.prod.override')({
// Don't attempt to continue if there are any errors.
bail: true,
// We generate sourcemaps in production. This is slow but gives good results.
Expand Down Expand Up @@ -277,4 +277,4 @@ module.exports = {
net: 'empty',
tls: 'empty'
}
};
});
5 changes: 5 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.override.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function prodConfigOverride(config) {
return config;
}

module.exports = prodConfigOverride;
2 changes: 2 additions & 0 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ prompt(
path.join('config', 'paths.js'),
path.join('config', 'polyfills.js'),
path.join('config', 'webpack.config.dev.js'),
path.join('config', 'webpack.config.dev.override.js'),
path.join('config', 'webpack.config.prod.js'),
path.join('config', 'webpack.config.prod.override.js'),
path.join('config', 'jest', 'cssTransform.js'),
path.join('config', 'jest', 'fileTransform.js'),
path.join('scripts', 'build.js'),
Expand Down