1devServer: {
2 open: true,
3 compress: true,
4 hot: true,
5 inline: true,
6 watchContentBase: true,
7 contentBase: resolve(process.cwd(), 'build'),
8 historyApiFallback: true,
9 before: (app, server, compiler) => {
10 const fileExist = existsSync('./src/setupProxyx.js')
11 if (fileExist) {
12 const pathProxy = resolve(process.cwd(), 'src/setupProxy')
13 return require(`${pathProxy}`)(app)
14 }
15 },
16 port: process.env.PORT || 3000,
17 liveReload: false
18 },
1devServer: {
2 open: true,
3 compress: true,
4 hot: true,
5 inline: true,
6 watchContentBase: true,
7 contentBase: resolve(process.cwd(), 'build'),
8 historyApiFallback: true,
9 before: (app, server, compiler) => {
10 const fileExist = existsSync('./src/setupProxyx.js')
11 if (fileExist) {
12 const pathProxy = resolve(process.cwd(), 'src/setupProxy')
13 return require(`${pathProxy}`)(app)
14 }
15 },
16 port: process.env.PORT || 3000,
17 liveReload: false
18 },
1devServer: {
2 open: true,
3 compress: true,
4 hot: true,
5 inline: true,
6 watchContentBase: true,
7 contentBase: resolve(process.cwd(), 'build'),
8 historyApiFallback: true,
9 before: (app, server, compiler) => {
10 const fileExist = existsSync('./src/setupProxy.js')
11 if (fileExist) {
12 const pathProxy = resolve(process.cwd(), 'src/setupProxy')
13 return require(`${pathProxy}`)(app)
14 }
15 },
16 port: process.env.PORT || 3000,
17 liveReload: false
18 },
1webpack serve --https --key ./path/to/server.key --cert ./path/to/server.crt --cacert ./path/to/ca.pem
1 devServer: {
2 contentBase: path.join(__dirname, 'dist'),
3 compress: true,
4 port: 9000,
5 },
6 // on package json file..
7 "start": "./node_modules/.bin/webpack serve",