Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const developmentEnvOnly = (clientWebpackConfig, serverWebpackConfig) => {
const isWebpackDevServer = process.env.WEBPACK_DEV_SERVER
//plugins
if (isWebpackDevServer) {
// Note, when this is run, we're building the server and client bundles in separate processes.
// Thus, this plugin is not applied.
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
clientWebpackConfig.plugins.push(
new ReactRefreshWebpackPlugin({
overlay: {
sockPort: devServer.port
}
})
)
}
clientWebpackConfig.plugins.push(
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: path.resolve(__dirname, '../../tsconfig.json')
},
async: false
})
)
}