Closed Mister-Hope closed 4 months ago
@Mister-Hope Any minimal reproduction for this issue? I could not reproduce it when trying to add e2e cases
@Mister-Hope Could help to create a valid reproduce in imports/conditional-exports
e2e test?
Totals | |
---|---|
Change from base Build 7649311635: | -0.02% |
Covered Lines: | 676 |
Relevant Lines: | 1701 |
See https://webpack.js.org/configuration/resolve/#resolveconditionnames
This solves a lot of issues.
I previously use alias with conditional checks (app.env.isDev, app.env.isBuild and bundler names) to ensure the correct file is used, but this can obviously fixed upstream here.
For example, when importing
@vue/repl
with webpack,@vue/repl
importvue/component-sfc
in it. And the latter use a condition export like this:Then webpack should pack
./dist/compiler-sfc.esm-browser.js
for it, and use"./dist/compiler-sfc.cjs.js"
for SSR.Another case can be
bcrypt-ts
The crypto module is different under node ('node:crypto') and browser (window.Crypto)