修复入口文件有样式引用时报错的bug

pull/1/head
yutent 2023-05-11 18:17:28 +08:00
parent 6a6a8e31c6
commit 0b398f4d67
2 changed files with 6 additions and 1 deletions

View File

@ -136,6 +136,11 @@ export function parseJs(
if (isBuild) {
ASSETS_DIR = '/assets/'
}
if (IS_ENTRY) {
fixedStyle += 'const __sheets__ = [...document.adoptedStyleSheets];\n'
}
try {
code = Es.transformSync(code).code || ''
} catch (e) {

View File

@ -1,7 +1,7 @@
{
"name": "fite",
"type": "module",
"version": "0.9.0",
"version": "0.9.1",
"bin": {
"fite": "index.js"
},