From f5de90be2c939bd1d3891b0256b790694b73e637 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 23 Feb 2023 00:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsfc=E7=9A=84=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/compile-vue.js | 4 +++- lib/constants.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/compile-vue.js b/lib/compile-vue.js index e812cb3..66c0dc3 100644 --- a/lib/compile-vue.js +++ b/lib/compile-vue.js @@ -90,6 +90,7 @@ export function parseJs( return ( code + .replace(/\r\n/g, '\n') .replace( /import ([\w\W]*?) from (["'])(.*?)\2/g, function (m, alias, q, name) { @@ -188,7 +189,7 @@ export function parseJs( * @return 返回转换后的js代码 */ export function compileVue(file, imports, options = {}, isBuild) { - let code = (fs.cat(file) || '').toString() + let code = (fs.cat(file) || '').toString().replace(/\r\n/g, '\n') let CACHE = options.CACHE || {} let js = code.match(JS_EXP) @@ -251,6 +252,7 @@ document.adoptedStyleSheets.push(stylesheet) */ export function parseHtml(html, { page, imports, entry }, isBuild = false) { return html + .replace(/\r\n/g, '\n') .replace( '', `