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( '', `