This commit is contained in:
24kycj
2026-05-12 21:42:42 +08:00
parent 31c9d64ba9
commit 68d1968376
21 changed files with 1120 additions and 273 deletions
+20 -2
View File
@@ -4,6 +4,8 @@ process.env.BABEL_ENV = 'web'
const path = require('path')
const webpack = require('webpack')
const config = require('../config')
const env = process.env.NODE_ENV === 'production' ? config.build.env : config.dev.env
const MinifyPlugin = require("babel-minify-webpack-plugin")
const CopyWebpackPlugin = require('copy-webpack-plugin')
@@ -107,6 +109,7 @@ let webConfig = {
options: options,
},
process,
isWeb: true,
};
},
minify: {
@@ -117,7 +120,9 @@ let webConfig = {
nodeModules: false
}),
new webpack.DefinePlugin({
'process.env.IS_WEB': 'true'
'process.env.IS_WEB': '"true"',
'process.env.BASE_API': env.BASE_API || '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"',
'process.env.VUE_APP_SOCKET_API': env.VUE_APP_SOCKET_API || '"ws://127.0.0.1:10010"'
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
@@ -129,11 +134,24 @@ let webConfig = {
resolve: {
alias: {
'@': path.join(__dirname, '../src/renderer'),
'@/platform': path.join(__dirname, '../src/renderer/platform/web.js'),
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['.js', '.vue', '.json', '.css']
},
target: 'web'
node: {
fs: 'empty',
path: 'empty',
child_process: 'empty'
},
target: 'web',
devServer: process.env.NODE_ENV !== 'production' ? {
port: 9081,
hot: true,
open: true,
contentBase: path.join(__dirname, '../'),
publicPath: '/'
} : undefined
}
/**