diff --git a/lib/dev.js b/lib/dev.js index a044478..06ef7e8 100644 --- a/lib/dev.js +++ b/lib/dev.js @@ -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) } diff --git a/package.json b/package.json index 64ccc42..8bc33b2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fite", "type": "module", - "version": "1.0.1", + "version": "1.0.2", "bin": { "fite": "index.js" },