ice
ice copied to clipboard
使用 vite-plugin-index-html 后,index.html 中的环境变量生产环境不会被替换,能否使用vite-plugin-html 进行替换?
Describe the bug
能否使用vite-plugin-html 进行替换?可以的话要怎么进行配置?
Expected behavior
index.html 中的环境变量能被正确替换
Actual behavior
No response
Version of ice.js
latest
Content of build.json or ice.config.mts
Additional context
No response
ice.js 2.x 内置 vite 版本相对比较老了,可以参考社区插件进行实现
ice.js 2.x 内置 vite 版本相对比较老了,可以参考社区插件进行实现
改为 vite-plugin-html 不行,帮忙看下?
import { createHtmlPlugin } from 'vite-plugin-html';
createHtmlPlugin({
template: resolve(__dirname, 'index.html'),
entry: resolve(__dirname, 'src/main.tsx'),
}),
build: {
rollupOptions: {
preserveEntrySignatures: 'exports-only',
},
},
vite-plugin-index-html 代码参考 https://github.com/alibaba/ice/tree/stable/2.x/packages/vite-plugin-index-html