diff --git a/packages/x-components/vite.config.js b/packages/x-components/vite.config.js index 323fa36978..9dd082eca6 100644 --- a/packages/x-components/vite.config.js +++ b/packages/x-components/vite.config.js @@ -1,7 +1,6 @@ import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue2'; import Inspector from 'vite-plugin-vue-inspector'; -import packageJSON from './package.json'; const vueDocsPlugin = { name: 'vue-docs', @@ -11,10 +10,6 @@ const vueDocsPlugin = { } }; -const dependencies = new Set( - Object.keys(packageJSON.dependencies).concat(Object.keys(packageJSON.peerDependencies)) -); - export default defineConfig({ plugins: [ vue(), @@ -24,29 +19,12 @@ export default defineConfig({ }) ], resolve: { - extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] + extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'], + alias: { + 'vue-runtime-helpers': 'node_modules/vue-runtime-helpers' + } }, server: { port: 8080 - }, - build: { - rollupOptions: { - external(id) { - /* - Rollup treats by default all node_modules dependencies as external, but will launch a - warning if you don't manually specify them. In our case apart from the package.json ones, - we also need to add any dependency that starts with rxjs (due to rxjs having multiple - entry points), and the vue-runtime-helpers, which is a dependency added by the SFC compiler - */ - return ( - dependencies.has(id) || // Package.json dependencies - /* As rxjs has multiple entry points, it needs to be declared this way */ - id.startsWith('rxjs') || - /* Vue SFC dependency. Needs to be here because rollup generates a relative import to the - node_modules folder */ - id.includes('vue-runtime-helpers') - ); - } - } } });