|
@@ -83,31 +83,37 @@ module.exports = {
|
|
|
devtool: 'cheap-module-source-map',
|
|
devtool: 'cheap-module-source-map',
|
|
|
// These are the "entry points" to our application.
|
|
// These are the "entry points" to our application.
|
|
|
// This means they will be the "root" imports that are included in JS bundle.
|
|
// This means they will be the "root" imports that are included in JS bundle.
|
|
|
- entry: [
|
|
|
|
|
- // Include an alternative client for WebpackDevServer. A client's job is to
|
|
|
|
|
- // connect to WebpackDevServer by a socket and get notified about changes.
|
|
|
|
|
- // When you save a file, the client will either apply hot updates (in case
|
|
|
|
|
- // of CSS changes), or refresh the page (in case of JS changes). When you
|
|
|
|
|
- // make a syntax error, this client will display a syntax error overlay.
|
|
|
|
|
- // Note: instead of the default WebpackDevServer client, we use a custom one
|
|
|
|
|
- // to bring better experience for Create React App users. You can replace
|
|
|
|
|
- // the line below with these two lines if you prefer the stock client:
|
|
|
|
|
- // require.resolve('webpack-dev-server/client') + '?/',
|
|
|
|
|
- // require.resolve('webpack/hot/dev-server'),
|
|
|
|
|
- require.resolve('react-dev-utils/webpackHotDevClient'),
|
|
|
|
|
- // Finally, this is your app's code:
|
|
|
|
|
- paths.appIndexJs,
|
|
|
|
|
- // We include the app code last so that if there is a runtime error during
|
|
|
|
|
- // initialization, it doesn't blow up the WebpackDevServer client, and
|
|
|
|
|
- // changing JS code would still trigger a refresh.
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ entry:{
|
|
|
|
|
+ index: [
|
|
|
|
|
+ // Include an alternative client for WebpackDevServer. A client's job is to
|
|
|
|
|
+ // connect to WebpackDevServer by a socket and get notified about changes.
|
|
|
|
|
+ // When you save a file, the client will either apply hot updates (in case
|
|
|
|
|
+ // of CSS changes), or refresh the page (in case of JS changes). When you
|
|
|
|
|
+ // make a syntax error, this client will display a syntax error overlay.
|
|
|
|
|
+ // Note: instead of the default WebpackDevServer client, we use a custom one
|
|
|
|
|
+ // to bring better experience for Create React App users. You can replace
|
|
|
|
|
+ // the line below with these two lines if you prefer the stock client:
|
|
|
|
|
+ // require.resolve('webpack-dev-server/client') + '?/',
|
|
|
|
|
+ // require.resolve('webpack/hot/dev-server'),
|
|
|
|
|
+ require.resolve('react-dev-utils/webpackHotDevClient'),
|
|
|
|
|
+ // Finally, this is your app's code:
|
|
|
|
|
+ paths.appIndexJs,
|
|
|
|
|
+ // We include the app code last so that if there is a runtime error during
|
|
|
|
|
+ // initialization, it doesn't blow up the WebpackDevServer client, and
|
|
|
|
|
+ // changing JS code would still trigger a refresh.
|
|
|
|
|
+ ],
|
|
|
|
|
+ design: [
|
|
|
|
|
+ require.resolve('react-dev-utils/webpackHotDevClient'),
|
|
|
|
|
+ paths.appSrc + "/design.js"
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
output: {
|
|
output: {
|
|
|
// Add /* filename */ comments to generated require()s in the output.
|
|
// Add /* filename */ comments to generated require()s in the output.
|
|
|
pathinfo: true,
|
|
pathinfo: true,
|
|
|
// This does not produce a real file. It's just the virtual path that is
|
|
// This does not produce a real file. It's just the virtual path that is
|
|
|
// served by WebpackDevServer in development. This is the JS bundle
|
|
// served by WebpackDevServer in development. This is the JS bundle
|
|
|
// containing code from all our entry points, and the Webpack runtime.
|
|
// containing code from all our entry points, and the Webpack runtime.
|
|
|
- filename: 'static/js/bundle.js',
|
|
|
|
|
|
|
+ filename: 'static/js/[name].bundle.js',
|
|
|
// There are also additional JS chunk files if you use code splitting.
|
|
// There are also additional JS chunk files if you use code splitting.
|
|
|
chunkFilename: 'static/js/[name].chunk.js',
|
|
chunkFilename: 'static/js/[name].chunk.js',
|
|
|
// This is the URL that app is served from. We use "/" in development.
|
|
// This is the URL that app is served from. We use "/" in development.
|
|
@@ -341,7 +347,14 @@ module.exports = {
|
|
|
// Generates an `index.html` file with the <script> injected.
|
|
// Generates an `index.html` file with the <script> injected.
|
|
|
new HtmlWebpackPlugin({
|
|
new HtmlWebpackPlugin({
|
|
|
inject: true,
|
|
inject: true,
|
|
|
|
|
+ chunks: ["index"],
|
|
|
|
|
+ template: paths.appHtml,
|
|
|
|
|
+ }),
|
|
|
|
|
+ new HtmlWebpackPlugin({
|
|
|
|
|
+ inject: true,
|
|
|
|
|
+ chunks: ["design"],
|
|
|
template: paths.appHtml,
|
|
template: paths.appHtml,
|
|
|
|
|
+ filename: 'design.html',
|
|
|
}),
|
|
}),
|
|
|
// Makes some environment variables available in index.html.
|
|
// Makes some environment variables available in index.html.
|
|
|
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
|
|
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
|