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

babel plugin을 적용해도 dynamic import syntax를 읽을 수 없는 경우 #32

Closed
SoYoung210 opened this issue Oct 10, 2019 · 2 comments
Labels

Comments

@SoYoung210
Copy link
Owner

♻️ Env

  • webpack: 4.35.2
  • html-webpack-pug-plugin: 2.0.0
  • webpack-bundle-analyzer: 3.3.2

Desc

{
  "presets": [
    "@babel/typescript",
    "@babel/react",
    ["@babel/env", {
      "targets": {
        "node": 6
      }
    }]
  ],
  "plugins": [
    "@babel/plugin-syntax-dynamic-import"
  ]
}

이렇게, dynamic import를 위한 babel설정을 잡아주었음에도, syntax error가 나는 경우가 있다.
이는, 패키지(특히 웹팩)를 npm으로 설치했을 때 peer dependency인 acorn을 참조하는 방식에서의 오류이므로 Ref에 적혀있는 방식으로 이슈를 해결하거나, 패키지 매니저로 yarn을 선택하면 해결된다..

Ref

webpack/webpack#8656 (comment)

@eastroots92
Copy link

eastroots92 commented Oct 17, 2019

요거 보시면 좋을 것 같습니다.
https://github.com/webpack/webpack/releases/tag/v4.35.3

@SoYoung210
Copy link
Owner Author

@eastroots92 감사합니다!
comment 를 참고했더니 이 부분에 대한 bug fix가 4.35.3 버전에서 있음을 확인했습니다.

현재 4.41.2(현재기준 최신) 버전을 npm으로 설치했고 정상동작합니다! 👍

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

No branches or pull requests

2 participants