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

@vue/cli issue 3.0 - production build #41

Open
JaeYeopHan opened this issue Feb 27, 2019 · 0 comments
Open

@vue/cli issue 3.0 - production build #41

JaeYeopHan opened this issue Feb 27, 2019 · 0 comments
Labels
related: vue Related vue type: material For sources

Comments

@JaeYeopHan
Copy link
Owner

JaeYeopHan commented Feb 27, 2019

Description

vue-cli-service build 커맨드로 build를 수행할 경우, NODE_ENV를 컨트롤 하면 안 된다.
vue-cli-service 내부적으로 NODE_ENV를 판단하여 build mode를 지정하고 있다.

$ NODE_ENV=beta vue-cli-service --mode development # development build
$ NODE_ENV=real vue-cli-service --mode production # production build

이렇게 하면 죽어라 빌드를 돌려도 프로덕션 빌드가 이루어지지 않음. 아래와 같이 해야 함.

$ vue-cli-service --mode development # development build
$ vue-cli-service --mode production # production build

다른 phase로 build를 해야하는데 production build로 해야할 경우, 별도 argument를 넘겨줘서 내부적으로 env를 custom하는 방식을 사용한다. 예를 들면 다음과 같이.

"scripts": {
  "build-dev": "vue-cli-service --mode development",
  "build-prod": "vue-cli-service --mode production",
  "build:beta": "npm run build-prod -- --phase=beta",
  "build:real": "npm run build-prod -- --phase=real"
}

Conclusion

  • NODE_END로 pahse를 컨트롤하지 않는다.
    • modephase를 구분한다.
  • VUE_ENV를 사용해본다. (뭔진 모름)
@JaeYeopHan JaeYeopHan added type: material For sources related: vue Related vue labels Feb 27, 2019
@JaeYeopHan JaeYeopHan changed the title @vue/cli issue - production build @vue/cli issue 3.0 - production build Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
related: vue Related vue type: material For sources
Projects
None yet
Development

No branches or pull requests

1 participant