-
Notifications
You must be signed in to change notification settings - Fork 385
/
Copy pathdevelopment.js
28 lines (22 loc) · 998 Bytes
/
development.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// The source code including full typescript support is available at:
// https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh/blob/master/config/webpack/development.js
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
const { devServer, inliningCss } = require('shakapacker');
const webpackConfig = require('./webpackConfig');
const developmentEnvOnly = (clientWebpackConfig, _serverWebpackConfig) => {
// plugins
if (inliningCss) {
// Note, when this is run, we're building the server and client bundles in separate processes.
// Thus, this plugin is not applied to the server bundle.
// eslint-disable-next-line global-require
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
clientWebpackConfig.plugins.push(
new ReactRefreshWebpackPlugin({
overlay: {
sockPort: devServer.port,
},
}),
);
}
};
module.exports = webpackConfig(developmentEnvOnly);