ice-lab / icestark

:tiger: Micro Frontends solution for large application(面向大型应用的微前端解决方案),站点国内镜像:https://icestark.gitee.io
https://micro-frontends.ice.work
MIT License
2.03k stars 173 forks source link

htmlPlugin is not a function #702

Closed homestylew closed 11 months ago

homestylew commented 11 months ago

"vite-plugin-index-html": "^2.0.2"

import htmlPlugin from "vite-plugin-index-html"; plugins: [ react(), htmlPlugin({ input: "src/main.tsx", preserveEntrySignatures: "exports-only", }), ], 报错htmlPlugin is not a function

wisdomofgod commented 11 months ago

邮件已收到~~

ClarkXia commented 11 months ago

未能复现这个问题,另外 vite-plugin-index-html 的源码上默认导出就是函数,你可以打印下 htmlPlugin 看是不是存在 default 属性

homestylew commented 11 months ago

我能私底下联系下你吗,我这边项目运行不起来

homestylew commented 11 months ago

未能复现这个问题,另外 vite-plugin-index-html 的源码上默认导出就是函数,你可以打印下 htmlPlugin 看是不是存在 default 属性

import htmlPlugin from "vite-plugin-index-html"; console.log(htmlPlugin); console.log(htmlPlugin?.default); 打印出来怎么是这样呢 { removeHtmlEntryScript: [Function: removeHtmlEntryScript], default: [Function: htmlPlugin] } [Function: htmlPlugin]

ClarkXia commented 11 months ago

跟你配置文件执行规范有关,跟插件本身没关系