Last night
This commit is contained in:
parent
2906b01734
commit
42ee2d4c51
47 changed files with 848 additions and 478 deletions
|
|
@ -1,6 +1,7 @@
|
|||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
|
|
@ -50,22 +51,34 @@ module.exports = (env, argv) => {
|
|||
new HtmlWebpackPlugin({
|
||||
template: './src/index.html',
|
||||
}),
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [{ from: 'public', noErrorOnMissing: true }],
|
||||
}),
|
||||
...(isProduction
|
||||
? [new MiniCssExtractPlugin()]
|
||||
: [new ReactRefreshWebpackPlugin()]),
|
||||
],
|
||||
devServer: {
|
||||
port: 3000,
|
||||
host: '0.0.0.0',
|
||||
port: 3001,
|
||||
allowedHosts: 'all',
|
||||
client: {
|
||||
webSocketURL: 'auto://0.0.0.0:0/ws',
|
||||
},
|
||||
historyApiFallback: {
|
||||
index: 'index.html',
|
||||
index: '/index.html',
|
||||
},
|
||||
hot: true,
|
||||
liveReload: true,
|
||||
proxy: [
|
||||
{
|
||||
context: ['/api'],
|
||||
target: 'http://localhost:8001',
|
||||
target: process.env.API_PROXY_TARGET || 'http://localhost:8001',
|
||||
},
|
||||
{
|
||||
context: ['/pb'],
|
||||
target: process.env.PB_PROXY_TARGET || 'http://localhost:8090',
|
||||
pathRewrite: { '^/pb': '' },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue