更新
This commit is contained in:
@@ -139,6 +139,7 @@ let rendererConfig = {
|
||||
options: options,
|
||||
},
|
||||
process,
|
||||
isWeb: false,
|
||||
};
|
||||
},
|
||||
minify: {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user