-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: playground/vue-ssr external config merge (#220)
- Loading branch information
Showing
1 changed file
with
26 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import config from './vite.config.js' | ||
/** | ||
* @type {import('vite').UserConfig} | ||
*/ | ||
export default Object.assign(config, { | ||
ssr: { | ||
noExternal: /./, | ||
}, | ||
resolve: { | ||
// necessary because vue.ssrUtils is only exported on cjs modules | ||
alias: [ | ||
{ | ||
find: '@vue/runtime-dom', | ||
replacement: '@vue/runtime-dom/dist/runtime-dom.cjs.js', | ||
}, | ||
{ | ||
find: '@vue/runtime-core', | ||
replacement: '@vue/runtime-core/dist/runtime-core.cjs.js', | ||
}, | ||
], | ||
}, | ||
optimizeDeps: { | ||
exclude: ['@vitejs/test-example-external-component'], | ||
}, | ||
import { defineConfig } from 'vite' | ||
import createConfig from './vite.config.js' | ||
|
||
export default defineConfig((env) => { | ||
const config = createConfig(env) | ||
return Object.assign(config, { | ||
ssr: { | ||
noExternal: /./, | ||
}, | ||
resolve: { | ||
// necessary because vue.ssrUtils is only exported on cjs modules | ||
alias: [ | ||
{ | ||
find: '@vue/runtime-dom', | ||
replacement: '@vue/runtime-dom/dist/runtime-dom.cjs.js', | ||
}, | ||
{ | ||
find: '@vue/runtime-core', | ||
replacement: '@vue/runtime-core/dist/runtime-core.cjs.js', | ||
}, | ||
], | ||
}, | ||
optimizeDeps: { | ||
exclude: ['@vitejs/test-example-external-component'], | ||
}, | ||
}) | ||
}) |