soiz1 commited on
Commit
4188c8a
·
verified ·
1 Parent(s): a228dbb

Update webpack.config.js

Browse files
Files changed (1) hide show
  1. webpack.config.js +17 -28
webpack.config.js CHANGED
@@ -31,34 +31,23 @@ const htmlWebpackPluginCommon = {
31
  const base = {
32
  mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
33
  devtool: process.env.SOURCEMAP ? process.env.SOURCEMAP : process.env.NODE_ENV === 'production' ? false : 'cheap-module-source-map',
34
- devServer: {
35
- static: {
36
- directory: path.resolve(__dirname, 'build')
37
- },
38
- host: '0.0.0.0',
39
- compress: true,
40
- port: process.env.PORT || 8601,
41
- historyApiFallback: {
42
- rewrites: [
43
- { from: /^\/\d+\/?$/, to: '/index.html' },
44
- { from: /^\/\d+\/fullscreen\/?$/, to: '/fullscreen.html' },
45
- { from: /^\/\d+\/editor\/?$/, to: '/editor.html' },
46
- { from: /^\/\d+\/playground\/?$/, to: '/playground.html' },
47
- { from: /^\/\d+\/embed\/?$/, to: '/embed.html' },
48
- { from: /^\/addons\/?$/, to: '/addons.html' }
49
- ]
50
  },
51
- setupMiddlewares(middlewares, devServer) {
52
- devServer.app.get('/stats.json', (req, res) => {
53
- const stats = devServer.stats.toJson({
54
- all: false,
55
- assets: true
56
- });
57
- res.json(stats);
58
- });
59
- return middlewares;
60
- }
61
- },
62
  output: {
63
  library: 'GUI',
64
  filename: process.env.NODE_ENV === 'production' ? 'js/[name].[contenthash].js' : 'js/[name].js',
@@ -305,4 +294,4 @@ module.exports = [
305
  })
306
  ])
307
  })) : []
308
- );
 
31
  const base = {
32
  mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
33
  devtool: process.env.SOURCEMAP ? process.env.SOURCEMAP : process.env.NODE_ENV === 'production' ? false : 'cheap-module-source-map',
34
+ devServer: {
35
+ contentBase: path.resolve(__dirname, 'build'),
36
+ host: '0.0.0.0',
37
+ compress: true,
38
+ port: process.env.PORT || 8601,
39
+ // allows ROUTING_STYLE=wildcard to work properly
40
+ historyApiFallback: {
41
+ rewrites: [
42
+ { from: /^\/\d+\/?$/, to: '/index.html' },
43
+ { from: /^\/\d+\/fullscreen\/?$/, to: '/fullscreen.html' },
44
+ { from: /^\/\d+\/editor\/?$/, to: '/editor.html' },
45
+ { from: /^\/\d+\/playground\/?$/, to: '/playground.html' },
46
+ { from: /^\/\d+\/embed\/?$/, to: '/embed.html' },
47
+ { from: /^\/addons\/?$/, to: '/addons.html' }
48
+ ]
49
+ }
50
  },
 
 
 
 
 
 
 
 
 
 
 
51
  output: {
52
  library: 'GUI',
53
  filename: process.env.NODE_ENV === 'production' ? 'js/[name].[contenthash].js' : 'js/[name].js',
 
294
  })
295
  ])
296
  })) : []
297
+ );