mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-05 21:12:13 +08:00
refactor: webpack 配置结构调整
This commit is contained in:
35
km-console/packages/config-manager-fe/config/webpack.dev.js
Normal file
35
km-console/packages/config-manager-fe/config/webpack.dev.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
||||
const pkgJson = require('../package');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
plugins: [
|
||||
new MiniCssExtractPlugin(),
|
||||
new ReactRefreshWebpackPlugin({
|
||||
overlay: false,
|
||||
}),
|
||||
],
|
||||
devServer: {
|
||||
host: '127.0.0.1',
|
||||
port: pkgJson.port,
|
||||
hot: true,
|
||||
open: false,
|
||||
publicPath: `http://localhost:${pkgJson.port}/${pkgJson.ident}/`,
|
||||
inline: true,
|
||||
disableHostCheck: true,
|
||||
historyApiFallback: true,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
},
|
||||
output: {
|
||||
path: '/',
|
||||
publicPath: `http://localhost:${pkgJson.port}/${pkgJson.ident}/`,
|
||||
library: pkgJson.ident,
|
||||
libraryTarget: 'amd',
|
||||
filename: '[name].js',
|
||||
chunkFilename: '[name].js',
|
||||
},
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
};
|
||||
Reference in New Issue
Block a user