Skip to content
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

建议:把环境变量传入webpack配置 #54

Open
jsspace opened this issue Nov 28, 2023 · 0 comments
Open

建议:把环境变量传入webpack配置 #54

jsspace opened this issue Nov 28, 2023 · 0 comments

Comments

@jsspace
Copy link

jsspace commented Nov 28, 2023

这个地方能不能把环境变量传进来,这个可以根据环境来设置不同的插件配置。

可以判断webpack是否是函数,如果是函数,执行之后再赋值

if (customConf.webpack) {
  if (typeof customConf.webpack === 'function') {
    customConf = customConf.webpack(defaultsOptions.nodeConf)
  } else {
    customConf = customConf.webpack
  }
}
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

1 participant