diff --git a/src/vueTransform.js b/src/vueTransform.js index 27f1b22..8af1a5a 100644 --- a/src/vueTransform.js +++ b/src/vueTransform.js @@ -54,9 +54,9 @@ async function processTemplate (source, id, content, options, nodes, modules) { const extras = { modules, id, lang: source.attrs.lang } const code = deIndent(source.code) const template = await ( - options.disableCssModuleStaticReplacement !== true - ? templateProcessor(code, extras, options) - : code + options.disableCssModuleStaticReplacement !== true + ? templateProcessor(code, extras, options) + : code ) if (!options.compileTemplate) { @@ -134,10 +134,10 @@ async function processStyle (styles, id, content, options) { map: map, lang: style.attrs.lang || 'css', module: 'module' in style.attrs ? style.attrs.module || true : false, - scoped: 'scoped' in style.attrs ? style.attrs.scoped || true : false + scoped: 'scoped' in style.attrs } - outputs.push(options.autoStyles ? await compile(output, options) : output) + outputs.push(options.autoStyles || output.scoped || output.module ? await compile(output, options) : output) } return outputs diff --git a/test/expects/scoped-css-with-no-auto-style.css b/test/expects/scoped-css-with-no-auto-style.css new file mode 100644 index 0000000..7ad84e9 --- /dev/null +++ b/test/expects/scoped-css-with-no-auto-style.css @@ -0,0 +1,16 @@ +.scoped-css-with-no-auto-style__test2 { + color: red; +} + + + + + + + + + + +.test[data-v-0cd69708] { + color: red; +} diff --git a/test/expects/scoped-css-with-no-auto-style.js b/test/expects/scoped-css-with-no-auto-style.js new file mode 100644 index 0000000..282db06 --- /dev/null +++ b/test/expects/scoped-css-with-no-auto-style.js @@ -0,0 +1,3 @@ +var scopedCssWithNoAutoStyle = { template: "