From 1265d0e94fca8f86f27d1131c71b6011400921b1 Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 16 May 2023 14:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E5=85=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/dev.js | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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" },