Skip to content

node_env #4334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thelongmarch opened this issue Jul 22, 2019 · 4 comments
Closed

node_env #4334

thelongmarch opened this issue Jul 22, 2019 · 4 comments

Comments

@thelongmarch
Copy link

What problem does this feature solve?

'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})

为什么要merge上之前的prod.env,
prod.env里面就一行内容
意义大吗

https://segmentfault.com/q/1010000012918070

What does the proposed API look like?

抱歉,没有cli2入口,大佬,能解释下为啥这么写?难道就是为了防止覆盖么

@haoqunjiang
Copy link
Member

https://github.com/vuejs-templates/webpack/blob/master/docs/env.md
实际使用时里面一般会有其他字段

@thelongmarch
Copy link
Author

感谢!!!
As we can see, test.env inherits the dev.env and the dev.env inherits the prod.env.

这个继承关系一定要这么写么?是因为prod字段肯定全,所以继承prod么?还有如果这样可以 test.env inherits the prod.env么

@haoqunjiang
Copy link
Member

当然可以,文档里只是举了个例子,完全可以根据实际情况自己修改。

@thelongmarch
Copy link
Author

好的,感谢!大佬休息的也好晚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants