Compare commits

..

No commits in common. "master" and "1.4.0" have entirely different histories.

4 changed files with 6 additions and 26 deletions

View File

@ -64,7 +64,7 @@ function scopeCss(css = '', hash) {
if (last.startsWith(':')) {
output = parseVDeep(last, output, true)
} else {
output = `${last}[data-${hash}] ${output}`
output = `${last} ${output}`
}
} else {
if (last.includes(':')) {
@ -241,8 +241,6 @@ export function parseJs(
` stylesheet.textContent = ${tmp};\n` +
` document.head.appendChild(stylesheet);\n` +
`}\n`
return `let ${tmp};\n!(async function(){\n ${tmp} = await __fite_import('${name}', import.meta.url);\n})()`
} else {
// CSSStyleSheet.replaceSync 需要FF v101, Safari 16.4才支持
fixedStyle +=
@ -253,9 +251,8 @@ export function parseJs(
` __sheets__.push(stylesheet);\n` +
` document.adoptedStyleSheets = __sheets__;\n` +
`}\n`
return `const ${tmp} = await __fite_import('${name}', import.meta.url)`
}
return `const ${tmp} = await __fite_import('${name}', import.meta.url)`
} else {
if (name.startsWith('@/')) {
name = name.replace('@/', urlJoin(DEPLOY_PATH, ASSETS_DIR))

View File

@ -179,10 +179,7 @@ export default async function createServer(root = '', conf = {}) {
currentPage,
IS_ENTRY: true,
DEPLOY_PATH,
LEGACY_MODE,
isCustomElement,
plugin,
define
LEGACY_MODE
},
page.entry
)
@ -273,12 +270,10 @@ export default async function createServer(root = '', conf = {}) {
break
case 'js':
case 'wasm':
{
let rpath = pathname.replace('@/', '')
let file
let isJson = false
let isWasm = rpath.endsWith('.wasm')
if (rpath.endsWith('json.js')) {
isJson = true
@ -314,8 +309,6 @@ export default async function createServer(root = '', conf = {}) {
} catch (err) {
console.log('%s 语法错误: %s', rpath, red(err.message))
}
} else if (isWasm) {
//
} else {
code = parseJs(
code + '',
@ -324,10 +317,7 @@ export default async function createServer(root = '', conf = {}) {
IS_MPA,
currentPage,
DEPLOY_PATH,
LEGACY_MODE,
isCustomElement,
plugin,
define
LEGACY_MODE
},
file
)

View File

@ -52,12 +52,7 @@ export default function compile(root = '', dist = '', conf = {}, verbose) {
)
const INJECT_SCSS = readFile(conf.inject?.scss)
const LEGACY_MODE = !!conf.legacy
const {
ABS_CONFIG_FILEPATH,
compileOptions = {},
define = {},
plugin = []
} = conf
const { ABS_CONFIG_FILEPATH, compileOptions = {}, define = {} } = conf
const { isCustomElement = defaultCustomElement } = compileOptions
conf.inject = conf.inject || { scss: '' }
@ -208,8 +203,6 @@ export default function compile(root = '', dist = '', conf = {}, verbose) {
doJob()
}
} else {
options.plugin = plugin
options.isCustomElement = isCustomElement
compileFiles(currentPage, page, list, options, {
verbose,
dist,

View File

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