修复开发模式

master
yutent 2024-08-01 13:55:40 +08:00
parent 2b9599781e
commit fa84cc0c5d
2 changed files with 13 additions and 3 deletions

View File

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

View File

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