diff --git a/runtime/vue2/build.vite.config.ts b/runtime/vue2/build.vite.config.ts index c72bc1574..e8cb81094 100644 --- a/runtime/vue2/build.vite.config.ts +++ b/runtime/vue2/build.vite.config.ts @@ -56,10 +56,10 @@ export default defineConfig(({ mode }) => { return { plugins: [ vue(), + externalGlobals({ 'vue-demi': 'VueDemi', vue: 'Vue' }, { exclude: [`./${mode}/index.html`] }), legacy({ targets: ['defaults', 'not IE 11'], }), - externalGlobals({ vue: 'Vue' }, { exclude: [`./${mode}/index.html`] }), ], root: `./${mode}/`, @@ -68,17 +68,17 @@ export default defineConfig(({ mode }) => { base: `/tmagic-editor/playground/runtime/vue2/${mode}`, + optimizeDeps: { + exclude: ['vue-demi'], + }, + build: { emptyOutDir: true, sourcemap: true, outDir: path.resolve(process.cwd(), `../../playground/public/runtime/vue2/${mode}`), - }, - - resolve: { - alias: [ - { find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm.js') }, - { find: /^vue-demi$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm.js') }, - ], + rollupOptions: { + external: ['vue', 'vue-demi'], + }, }, }; } diff --git a/runtime/vue2/dev.vite.config.ts b/runtime/vue2/dev.vite.config.ts index fef11838a..db6add659 100644 --- a/runtime/vue2/dev.vite.config.ts +++ b/runtime/vue2/dev.vite.config.ts @@ -46,25 +46,13 @@ export default defineConfig({ publicDir: 'public', + optimizeDeps: { + exclude: ['vue-demi'], + }, + server: { host: '0.0.0.0', port: 8078, strictPort: true, }, - - build: { - sourcemap: true, - - cssCodeSplit: false, - - rollupOptions: { - input: { - page: './page/index.html', - playground: './playground/index.html', - }, - output: { - entryFileNames: 'assets/[name].js', - }, - }, - }, }); diff --git a/runtime/vue2/page/index.html b/runtime/vue2/page/index.html index 62759d74e..551426155 100644 --- a/runtime/vue2/page/index.html +++ b/runtime/vue2/page/index.html @@ -25,10 +25,13 @@ display: none; } + + +
- +