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 watch 대응 #2

Closed
beadss opened this issue Jun 5, 2017 · 1 comment
Closed

webpack watch 대응 #2

beadss opened this issue Jun 5, 2017 · 1 comment
Milestone

Comments

@beadss
Copy link
Contributor

beadss commented Jun 5, 2017

webpack watch 대응으로 적용했던 아래 커밋은 잘못됐습니다.
bd8ade9

watch에서 본 플러그인이 정상동작 하지 않는 이유들은 아래와 같습니다.

  1. watch로 인해 재 실행될때마다 이전의 manifest 파일을 읽어옴
  2. html 파일은 수정되지 않아 재배포되지 않았으므로 app.js 등이 아닌 app-hash@#.js라서 replace 불가능

해결책은 아래와 같습니다.

  1. 수행 시점을 after-emit으로 두고, compilation.assets[manifest파일명]으로 얻어온 문자열을 JSON.parse한다.
  2. 기존 manifest 데이터를 캐시해두고, 플러그인 실행 시 변경 사항을 확인한 후 치환 식별자로 chunk name을 사용할지, hash가 합쳐진 chunk name을 사용할지 결정

물론 가장 먼저 해야될 일은 watch를 지원할 것인가 여부입니다.
만약 지원하지 않는다면, readme.md 등에 기록해두는게 좋을 것 같습니다.

@unchai unchai added this to the v1.0.0 milestone Jul 2, 2018
@unchai
Copy link
Owner

unchai commented Jul 2, 2018

답변이 많이 늦었습니다.
webpack watch mode는 다음 major 버전에서 사용할 수 있도록 구현될 예정입니다. 현재 구조로는 webpack-manifest-plugin에 의존적이라 사용에 제한이 많은데요, 해당 plugin과 의존관계를 끊고 watch mode와 더불어 webpack-dev-server도 지원되도록 개선하겠습니다. 빠르면 이번달에 릴리즈 하겠습니다. 감사합니다.

unchai pushed a commit that referenced this issue Jul 2, 2018
feat: #2
feat: #4
unchai pushed a commit that referenced this issue Jul 2, 2018
fixes #2
fixes #4
unchai pushed a commit that referenced this issue Jul 7, 2018
fixes #2
fixes #4
unchai pushed a commit that referenced this issue Jul 7, 2018
fixes #2
fixes #4
@unchai unchai closed this as completed in 66f521e Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants