Skip to content

Commit f765c21

Browse files
committed
updates required for webpack 5
1 parent d75621a commit f765c21

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

middleware/webpack.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
const webpack = require('webpack')
22
const middleware = require('webpack-dev-middleware')
33
const config = require('../webpack.config')
4-
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
54

65
const webpackCompiler = webpack({
76
...config,
8-
mode: 'development',
97
plugins: [
10-
...config.plugins,
11-
new FriendlyErrorsWebpackPlugin({
12-
clearConsole: false
13-
})
8+
...config.plugins
149
]
1510
})
1611

1712
module.exports = middleware(webpackCompiler, {
18-
publicPath: config.output.publicPath,
19-
logLevel: 'silent'
13+
publicPath: config.output.publicPath
2014
})

webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ const { EnvironmentPlugin } = require('webpack')
55
const { reactBabelOptions } = require('./lib/react/babel')
66

77
module.exports = {
8+
mode: 'development',
89
devtool: 'source-map', // this prevents webpack from using eval
910
entry: './javascripts/index.js',
1011
output: {
1112
filename: 'index.js',
1213
path: path.resolve(__dirname, 'dist'),
1314
publicPath: '/dist'
1415
},
16+
// infrastructureLogging: { level: 'none' },
17+
stats: 'errors-only',
1518
module: {
1619
rules: [
1720
{
@@ -85,6 +88,8 @@ module.exports = {
8588
{ from: 'node_modules/@primer/css/fonts', to: 'fonts' }
8689
]
8790
}),
88-
new EnvironmentPlugin(['NODE_ENV'])
91+
new EnvironmentPlugin({
92+
NODE_ENV: 'development' // use 'development' unless process.env.NODE_ENV is defined
93+
})
8994
]
9095
}

0 commit comments

Comments
 (0)