Closed romgere closed 2 years ago
Thanks for sharing a reproduction.
Your reproduction is using ember-auto-import 1.11.3. I updated it to the current release (2.2.4) and it works.
I should clarify though:
Out of the box, we only support standards-compliant javascript in third-party dependencies. Since numeric separators are part of the ES2021 standard, they're supported if you have new enough dependencies.
If you really wanted to apply custom babel to third-party code you can, but you need to do it directly by putting your own module.rules
in ember-auto-import's webpack config, applying babel loader, etc. You can tell the built-in babel to ignore some packages using the skipBabel option so that your custom babel can be responsible for those ones.
Thx a lot @ef4 for the fast answer 🙏🏻 I'll wait to be able to update to auto-import v2 to update the concerned deps.
We're currently tied to ember-auto-import v1. One of our node_modules dependencies uses import.meta
which throws the following error from ember-auto-import/babel-loader:
Support for the experimental syntax 'importMeta' isn't currently enabled
and prompts the following resolve:
Add @babel/plugin-syntax-import-meta (https://git.io/vbKK6) to the 'plugins' section of your Babel config to enable parsing.
Attempting to add this module to skipBabel
did not appear to get applied. How would I inform ember-auto-loader to ignore this issue?
I'm working on a add-on wich use some npm dep with auto-import (
v1.11.3
)One deps use es12 numeric separator in last release, when I'm trying to update, the build ends with "module parse failed" error due to the statement with the numeric separator syntax.
I tried to fix this issue by :
babel.plugins
key of myindex.js
(also tried directly in ember-cli-build.js)But still the same issue 😕
I was thinkink that
ember-auto-import
used babel & should take into account the babel plugin mentionned above ? or did I missed something ?Here is a fresh app (not an add-on) reproducing the issue : https://github.com/romgere/test-auto-import-babel