Open Clarkkkk opened 1 month ago
My vite.config.ts
is like:
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import legacy from 'vite-plugin-legacy-swc'
import qiankun from 'vite-plugin-qiankun-lite'
import tsconfigPaths from 'vite-tsconfig-paths'
const PORT = 7153
export default defineConfig(({ command }) => {
return {
plugins: [
react(),
tsconfigPaths(),
legacy({
renderModernChunks: false
}),
qiankun({ name: 'app', sandbox: false })
],
envPrefix: 'APP_',
base: '/',
server: {
origin: `http://localhost:${PORT}`,
port: PORT
}
}
})
I think it has something to do with type="module"
script. When i set renderModernChunks: false
, the lifecycles are not injected.
i know
vite-plugin-qiankun-lite
inject a script in the output html to support qiankun lifecycles like this:but when used with @vitejs/plugin-qiankun, the injected script is removed in the output html. Any solutions?