We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In SSR, if pkg browser field or alternative (like exports.browser) is present, it's always used as pkg entry.
browser
exports.browser
This only happens in mono repos, packages installed in node_modules are correctly resolved.
node_modules
Create a package in Vite monorepo itself:
packages/foo/node.js:
packages/foo/node.js
console.log('node')
packages/foo/browser.js:
packages/foo/browser.js
console.log('browser')
packages/foo/package.json:
packages/foo/package.json
{ "name": "foo", "version": "0.0.0", "main": "node.js", "browser": "browser.js" }
And import the package in packages/playground/ssr-vue/src/main.js:
packages/playground/ssr-vue/src/main.js
import 'foo'
Run yarn workspace test-ssr-vue dev, it always prints browser.
yarn workspace test-ssr-vue dev
vite
185a727715db4a
The text was updated successfully, but these errors were encountered:
fixed via 92934d4
Sorry, something went wrong.
No branches or pull requests
Describe the bug
In SSR, if pkg
browser
field or alternative (likeexports.browser
) is present, it's always used as pkg entry.This only happens in mono repos, packages installed in
node_modules
are correctly resolved.Reproduction
Create a package in Vite monorepo itself:
packages/foo/node.js
:packages/foo/browser.js
:packages/foo/package.json
:And import the package in
packages/playground/ssr-vue/src/main.js
:Run
yarn workspace test-ssr-vue dev
, it always printsbrowser
.System Info
vite
version: 2.0.0-beta.65 main branch (185a727715db4a
)The text was updated successfully, but these errors were encountered: