Skip to content

Commit

Permalink
fix: playground/vue-ssr external config merge (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1mersnow authored Aug 15, 2023
1 parent e014680 commit 4d417cb
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions playground/ssr-vue/vite.config.noexternal.js
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'],
},
})
})

0 comments on commit 4d417cb

Please sign in to comment.