修复入口文件有样式引用时报错的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) { if (isBuild) {
ASSETS_DIR = '/assets/' ASSETS_DIR = '/assets/'
} }
if (IS_ENTRY) {
fixedStyle += 'const __sheets__ = [...document.adoptedStyleSheets];\n'
}
try { try {
code = Es.transformSync(code).code || '' code = Es.transformSync(code).code || ''
} catch (e) { } catch (e) {

View File

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