|
@@ -19,100 +19,95 @@ module.exports = {
|
|
|
|
|
|
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
|
|
|
|
|
- outputDir: 'dist',
|
|
|
+ outputDir: "dist",
|
|
|
|
|
|
- assetsDir: 'static',
|
|
|
+ assetsDir: "static",
|
|
|
|
|
|
- lintOnSave: process.env.NODE_ENV === 'development',
|
|
|
+ lintOnSave: process.env.NODE_ENV === "development",
|
|
|
|
|
|
productionSourceMap: false,
|
|
|
|
|
|
devServer: {
|
|
|
- host: '0.0.0.0',
|
|
|
- port: port,
|
|
|
+
|
|
|
+
|
|
|
open: true,
|
|
|
proxy: {
|
|
|
|
|
|
[process.env.VUE_APP_BASE_API]: {
|
|
|
- target: `http://localhost:8112`,
|
|
|
+ target: `http://192.168.1.197`,
|
|
|
changeOrigin: true,
|
|
|
- pathRewrite: {
|
|
|
- ['^' + process.env.VUE_APP_BASE_API]: ''
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
},
|
|
|
- disableHostCheck: true
|
|
|
+ disableHostCheck: true,
|
|
|
},
|
|
|
configureWebpack: {
|
|
|
name: name,
|
|
|
resolve: {
|
|
|
alias: {
|
|
|
- '@': resolve('src')
|
|
|
- }
|
|
|
- }
|
|
|
+ "@": resolve("src"),
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
chainWebpack(config) {
|
|
|
- config.plugins.delete('preload')
|
|
|
- config.plugins.delete('prefetch')
|
|
|
+ config.plugins.delete("preload");
|
|
|
+ config.plugins.delete("prefetch");
|
|
|
|
|
|
|
|
|
+ config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
|
|
|
config.module
|
|
|
- .rule('svg')
|
|
|
- .exclude.add(resolve('src/assets/icons'))
|
|
|
- .end()
|
|
|
- config.module
|
|
|
- .rule('icons')
|
|
|
+ .rule("icons")
|
|
|
.test(/\.svg$/)
|
|
|
- .include.add(resolve('src/assets/icons'))
|
|
|
+ .include.add(resolve("src/assets/icons"))
|
|
|
.end()
|
|
|
- .use('svg-sprite-loader')
|
|
|
- .loader('svg-sprite-loader')
|
|
|
+ .use("svg-sprite-loader")
|
|
|
+ .loader("svg-sprite-loader")
|
|
|
.options({
|
|
|
- symbolId: 'icon-[name]'
|
|
|
+ symbolId: "icon-[name]",
|
|
|
})
|
|
|
- .end()
|
|
|
+ .end();
|
|
|
|
|
|
- config
|
|
|
- .when(process.env.NODE_ENV !== 'development',
|
|
|
- config => {
|
|
|
- config
|
|
|
- .plugin('ScriptExtHtmlWebpackPlugin')
|
|
|
- .after('html')
|
|
|
- .use('script-ext-html-webpack-plugin', [{
|
|
|
-
|
|
|
- inline: /runtime\..*\.js$/
|
|
|
- }])
|
|
|
- .end()
|
|
|
- config
|
|
|
- .optimization.splitChunks({
|
|
|
- chunks: 'all',
|
|
|
- cacheGroups: {
|
|
|
- libs: {
|
|
|
- name: 'chunk-libs',
|
|
|
- test: /[\\/]node_modules[\\/]/,
|
|
|
- priority: 10,
|
|
|
- chunks: 'initial'
|
|
|
- },
|
|
|
- elementUI: {
|
|
|
- name: 'chunk-elementUI',
|
|
|
- priority: 20,
|
|
|
- test: /[\\/]node_modules[\\/]_?element-ui(.*)/
|
|
|
- },
|
|
|
- commons: {
|
|
|
- name: 'chunk-commons',
|
|
|
- test: resolve('src/components'),
|
|
|
- minChunks: 3,
|
|
|
- priority: 5,
|
|
|
- reuseExistingChunk: true
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- config.optimization.runtimeChunk('single'),
|
|
|
+ config.when(process.env.NODE_ENV !== "development", (config) => {
|
|
|
+ config
|
|
|
+ .plugin("ScriptExtHtmlWebpackPlugin")
|
|
|
+ .after("html")
|
|
|
+ .use("script-ext-html-webpack-plugin", [
|
|
|
{
|
|
|
- from: path.resolve(__dirname, './public/robots.txt'),
|
|
|
- to: './',
|
|
|
- }
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
+ inline: /runtime\..*\.js$/,
|
|
|
+ },
|
|
|
+ ])
|
|
|
+ .end();
|
|
|
+ config.optimization.splitChunks({
|
|
|
+ chunks: "all",
|
|
|
+ cacheGroups: {
|
|
|
+ libs: {
|
|
|
+ name: "chunk-libs",
|
|
|
+ test: /[\\/]node_modules[\\/]/,
|
|
|
+ priority: 10,
|
|
|
+ chunks: "initial",
|
|
|
+ },
|
|
|
+ elementUI: {
|
|
|
+ name: "chunk-elementUI",
|
|
|
+ priority: 20,
|
|
|
+ test: /[\\/]node_modules[\\/]_?element-ui(.*)/,
|
|
|
+ },
|
|
|
+ commons: {
|
|
|
+ name: "chunk-commons",
|
|
|
+ test: resolve("src/components"),
|
|
|
+ minChunks: 3,
|
|
|
+ priority: 5,
|
|
|
+ reuseExistingChunk: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ config.optimization.runtimeChunk("single"),
|
|
|
+ {
|
|
|
+ from: path.resolve(__dirname, "./public/robots.txt"),
|
|
|
+ to: "./",
|
|
|
+ };
|
|
|
+ });
|
|
|
+ },
|
|
|
+};
|