diff --git a/toolkit/bundler/src/lib/design.web.ts b/toolkit/bundler/src/lib/design.web.ts index c2210cf9..20290f90 100644 --- a/toolkit/bundler/src/lib/design.web.ts +++ b/toolkit/bundler/src/lib/design.web.ts @@ -25,6 +25,18 @@ export default defineConfig(env => mergeConfig( output: { chunkFileNames: 'chunks/[hash]/[name].js', }, + external: [ + /* React */ + 'react', + 'react-dom', + 'react-native', + 'react-native-web', + 'react/jsx-runtime', + /* I18n */ + '@linguijs/core', + '@linguijs/react', + '@linguijs/macro', + ], }, }, plugins: [ diff --git a/toolkit/bundler/src/lib/exo.native.ts b/toolkit/bundler/src/lib/exo.native.ts index 965affb9..15ed7f7f 100644 --- a/toolkit/bundler/src/lib/exo.native.ts +++ b/toolkit/bundler/src/lib/exo.native.ts @@ -50,6 +50,18 @@ export default defineConfig(env => mergeConfig( output: { chunkFileNames: 'chunks/[hash]/[name].js' }, + external: [ + /* React */ + 'react', + 'react-dom', + 'react-native', + 'react-native-web', + 'react/jsx-runtime', + /* I18n */ + '@linguijs/core', + '@linguijs/react', + '@linguijs/macro', + ], }, }, plugins: [ diff --git a/toolkit/bundler/src/lib/exo.web.ts b/toolkit/bundler/src/lib/exo.web.ts index 8b484a22..aec54fbd 100644 --- a/toolkit/bundler/src/lib/exo.web.ts +++ b/toolkit/bundler/src/lib/exo.web.ts @@ -52,14 +52,25 @@ export default defineConfig(env => mergeConfig( } }, rollupOptions: { + output: { + chunkFileNames: 'chunks/[hash]/[name].js' + }, external: [ + /* React */ + 'react', + 'react-dom', + 'react-native', + 'react-native-web', + 'react/jsx-runtime', + /* I18n */ + '@linguijs/core', + '@linguijs/react', + '@linguijs/macro', + /* Vendor */ '@vidstack/react', '@dotlottie/common', '@dotlottie/react-player' ], - output: { - chunkFileNames: 'chunks/[hash]/[name].js' - }, }, }, optimizeDeps: { diff --git a/toolkit/bundler/src/vite.base.ts b/toolkit/bundler/src/vite.base.ts index cc5914d4..43aff508 100644 --- a/toolkit/bundler/src/vite.base.ts +++ b/toolkit/bundler/src/vite.base.ts @@ -2,22 +2,6 @@ import {defineConfig} from 'vite'; import paths from 'vite-tsconfig-paths'; export default defineConfig(env => ({ - build: { - rollupOptions: { - external: [ - /* React */ - 'react', - 'react-dom', - 'react-native', - 'react-native-web', - 'react/jsx-runtime', - /* I18n */ - '@linguijs/core', - '@linguijs/react', - '@linguijs/macro', - ], - }, - }, define: { __DEV__: JSON.stringify(env.mode === 'development'), },