diff --git a/lib/compile-vue.js b/lib/compile-vue.js index 13f1167..5a1afe2 100644 --- a/lib/compile-vue.js +++ b/lib/compile-vue.js @@ -58,9 +58,9 @@ export function compileScss(file, mini = true) { let style = mini ? 'compressed' : 'expanded' try { if (fs.isfile(file)) { - return scss.compile(file, { style, ...OPTIONS }).css + return scss.compile(file, { style, ...OPTIONS }).css.trim() } else { - return scss.compileString(file, { style, ...OPTIONS }).css + return scss.compileString(file, { style, ...OPTIONS }).css.trim() } } catch (err) { console.error(err) @@ -177,13 +177,11 @@ export function compileVue(file, imports, options = {}, isBuild) { }) js += ` - let stylesheet = new CSSStyleSheet() - stylesheet.path = '${file.slice( - options.IS_MPA ? options.pagesDir.length : options.root.length - )}' - stylesheet.replaceSync(\`${scss.join('\n')}\`) - document.adoptedStyleSheets.push(stylesheet) - ` +let stylesheet = new CSSStyleSheet() +stylesheet.path = '${file.slice(options.IS_MPA ? options.pagesDir.length : options.root.length)}' +stylesheet.replaceSync(\`${scss.join(' ')}\`) +document.adoptedStyleSheets.push(stylesheet) + ` } return js