Closed imagoiq closed 3 years ago
But Vue CLI won't enable this plugin unless NODE_ENV
equals test
or you are invoking the test:unit
command. What's your configuration?
Thanks for your quick reply. You actually gave me a good hint. My .env was based on an old configuration provided by vue-element-admin
which with vue-cli 3 promoted the use of VUE_CLI_BABEL_TRANSPILE_MODULES
for faster compilation which doesn't work as expect with vue-cli 4 according to their doc: https://github.com/PanJiaChen/vue-element-admin-site/blob/master/docs/es/guide/advanced/lazy-loading.md#vue-cli3-the-plan-has-been-eliminated
Version
4.5.7
Reproduction link
https://github.com/babel/babel/issues/11607
Environment info
Steps to reproduce
Upgrading from 4.3.1 to 4.4.0 (theoretically. It was tested with the latest version only: 4.5.7.)
What is expected?
No warning
What is actually happening?
A webpack warning at the end of the dev build:
Critical dependency: the request of a dependency is an expression
.Modules or files using dynamic import are impacted and doesn't load anymore.
Forcing the resolutions of
babel-plugin-dynamic-import-node
to 2.3.0 fix the issues (vue-cli from 4.4.0 to 4.5.7use 2.3.3).According to Babel community (https://github.com/babel/babel/issues/11607), vue-cli should not use
babel-plugin-dynamic-import-node
(or should use the webpack versionbabel-plugin-dynamic-import-webpack
).