Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Revert "perf(vite): do not resolve module field for packages (#2636)"
Browse files Browse the repository at this point in the history
This reverts commit a2e2e04.
  • Loading branch information
danielroe committed Jan 17, 2022
1 parent 429c31c commit e51c4fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions packages/bridge/src/vite/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ export async function buildServer (ctx: ViteBuildContext) {
},
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite/server'),
resolve: {
alias,
// By default Vite resolves `module` field, which not always a native ESM module
// Setting this option can bypass that and fallback to cjs version
mainFields: ctx.nuxt.options.dev ? ['main'] : undefined
alias
},
ssr: {
external: [
Expand Down
6 changes: 1 addition & 5 deletions packages/vite/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ export async function buildServer (ctx: ViteBuildContext) {
'@vue/shared': _resolve(`@vue/shared/dist/shared.cjs${ctx.nuxt.options.dev ? '' : '.prod'}.js`),
'vue-router': _resolve(`vue-router/dist/vue-router.cjs${ctx.nuxt.options.dev ? '' : '.prod'}.js`),
vue: _resolve(`vue/dist/vue.cjs${ctx.nuxt.options.dev ? '' : '.prod'}.js`)
},
// By default Vite resolves `module` field, which not always a native ESM module
// Setting this option can bypass that and fallback to cjs version
// TODO: Fix nitro/unenv issue with `main` field
mainFields: ctx.nuxt.options.dev ? ['main'] : undefined
}
},
ssr: {
external: [],
Expand Down

0 comments on commit e51c4fc

Please sign in to comment.