mirror of
https://github.com/QingdaoU/OnlineJudgeFE.git
synced 2024-12-28 07:21:50 +00:00
using NODE_ENV=development npm run build:dll
to build a dev dll
This commit is contained in:
parent
3b41ab15fc
commit
b050291911
@ -62,7 +62,7 @@ Modern browsers and Internet Explorer 10+.
|
||||
```bash
|
||||
# we use webpack DllReference to decrease the build time,
|
||||
# this command only needs execute once unless you upgrade the package in build/webpack.dll.conf.js
|
||||
npm run build:dll
|
||||
NODE_ENV=development npm run build:dll
|
||||
|
||||
# the dev-server will set proxy table to your backend
|
||||
export TARGET=http://Your-backend
|
||||
|
@ -70,3 +70,8 @@ exports.styleLoaders = function (options) {
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
exports.getNodeEnv = function () {
|
||||
const NODE_ENV = process.env.NODE_ENV
|
||||
return NODE_ENV ? NODE_ENV: 'production'
|
||||
}
|
||||
|
@ -2,6 +2,9 @@ const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||
const config = require('../config')
|
||||
const utils = require('./utils')
|
||||
|
||||
const NODE_ENV = utils.getNodeEnv()
|
||||
|
||||
const vendors = [
|
||||
'vue/dist/vue.esm.js',
|
||||
@ -25,7 +28,7 @@ module.exports = {
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': config.build.env
|
||||
'process.env': NODE_ENV === 'production' ? config.build.env : config.dev.env
|
||||
}),
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /zh-cn/),
|
||||
|
Loading…
Reference in New Issue
Block a user