You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{federation}from'@module-federation/vite';importreactfrom'@vitejs/plugin-react';import{defineConfig}from'vite';importtopLevelAwaitfrom'vite-plugin-top-level-await';// https://vitejs.dev/config/exportdefaultdefineConfig({server: {open: true,port: 5176,origin: 'http://localhost:5176',},preview: {port: 5176,},base: 'http://localhost:5176/testbase',plugins: [react({jsxImportSource: '@emotion/react'}),federation({name: '@namespace/viteViteRemote',exposes: {'./App1': './src/App1','./App2': './src/App2.jsx','./AgGridDemo': './src/AgGridDemo.jsx','./MuiDemo': './src/MuiDemo.jsx','./StyledDemo': './src/StyledDemo.jsx','./EmotionDemo': './src/EmotionDemo.jsx','.': './src/App.jsx',},filename: 'remoteEntry-[hash].js',manifest: true,shared: {vue: {},'react/': {},react: {requiredVersion: '18',},'react-dom/': {},'react-dom': {},'styled-components': {singleton: true},'ag-grid-community/': {},'ag-grid-react': {},'@emotion/react': {},'@emotion/styled': {singleton: true},'@mui/material': {},},}),// If you set build.target: "chrome89", you can remove this plugintopLevelAwait({// The export name of top-level await promise for each chunk modulepromiseExportName: '__tla',// The function to generate import names of top-level await promise in each chunk modulepromiseImportName: (i)=>`__tla_${i}`,}),],build: {target: 'chrome87',rollupOptions: {output: {chunkFileNames: 'static/js/[name]-[hash].js',entryFileNames: 'static/js/[name]-[hash].js',assetFileNames: 'static/[ext]/[name]-[hash].[ext]',},},},});
remote folder in vite-vite example
Even if you change the target to chrome87 and use topLevelAwait when building, an error occurs.
The text was updated successfully, but these errors were encountered:
ITSWYoo
changed the title
vite-vite example top level await error
vite-vite example top-level-await error
Jan 24, 2025
remote folder in vite-vite example
Even if you change the target to
chrome87
and use topLevelAwait when building, an error occurs.The text was updated successfully, but these errors were encountered: