mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
refactor: add node_env in webpack DefinePlugin (#4330)
This commit is contained in:
parent
853ca4e7d4
commit
3702dfe5dc
@ -25,6 +25,7 @@ export default class WebpackBaseConfig {
|
||||
this.options = builder.context.options
|
||||
this.spinner = builder.spinner
|
||||
this.loaders = this.options.build.loaders
|
||||
this.buildMode = this.options.dev ? 'development' : 'production'
|
||||
}
|
||||
|
||||
get colors() {
|
||||
@ -85,6 +86,7 @@ export default class WebpackBaseConfig {
|
||||
|
||||
env() {
|
||||
const env = {
|
||||
'process.env.NODE_ENV': JSON.stringify(this.buildMode),
|
||||
'process.mode': JSON.stringify(this.options.mode),
|
||||
'process.static': this.isStatic
|
||||
}
|
||||
@ -319,7 +321,7 @@ export default class WebpackBaseConfig {
|
||||
const webpackModulesDir = ['node_modules'].concat(this.options.modulesDir)
|
||||
const config = {
|
||||
name: this.name,
|
||||
mode: this.options.dev ? 'development' : 'production',
|
||||
mode: this.buildMode,
|
||||
devtool: this.devtool(),
|
||||
optimization: this.optimization(),
|
||||
output: this.output(),
|
||||
|
Loading…
Reference in New Issue
Block a user