优化注入提示

pull/1/head 1.0.2
yutent 2023-05-16 14:29:34 +08:00
parent 97a10f3235
commit 1265d0e94f
2 changed files with 7 additions and 2 deletions

View File

@ -207,12 +207,17 @@ export default async function createServer(root = '', conf = {}) {
if (!fs.isfile(file)) {
friendlyErrors(pathname, ext)
res.setHeader('content-type', MIME_TYPES.html)
res.writeHead(404, 'Not Found')
res.end('')
return
}
}
if (file === conf.inject?.scss) {
console.log(red('设置为注入的样式文件不可被vue/js文件引用\n'))
res.writeHead(404, 'Not Found')
res.end('')
return
}
code = compileScss(file)
res.setHeader('content-type', MIME_TYPES.css)
}

View File

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