You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bundle these dependencies into our dist files (e.g. with Rollup)
#1 would be the simplest solution, but it's a breaking change. And I'm not sure how realistic it is, given Jest's lack of mainstream support for ESM. (E.g. would it even be possible to import @lwc/compiler into a jest.config.js file, if it's "type": "module"?)
#2 is kind of gross, but may be the most pragmatic solution. We can continue to ship both CJS and ESM as we do today, without breaking downstream consumers of our npm package.
The text was updated successfully, but these errors were encountered:
A third option is to use dynamic import() to import the ESM package from CommonJS. But this seems unfeasible given that we expose synchronous APIs. (Or our async APIs are deprecated, e.g. transform is deprecated in favor of transformSync.)
Right now we have several dependencies that we can't update, because they rely on ES Modules rather than CommonJS:
parse5
estree-walker
webdriverio
(For
webdriverio
it's less severe, since it's only adevDep
.)I see two options for solving this:
"type": "module"
#3017dist
files (e.g. with Rollup)#1 would be the simplest solution, but it's a breaking change. And I'm not sure how realistic it is, given Jest's lack of mainstream support for ESM. (E.g. would it even be possible to import
@lwc/compiler
into ajest.config.js
file, if it's"type": "module"
?)#2 is kind of gross, but may be the most pragmatic solution. We can continue to ship both CJS and ESM as we do today, without breaking downstream consumers of our npm package.
The text was updated successfully, but these errors were encountered: