vuejs / vue-component-compiler

Compile a single file Vue component into a CommonJS module.
MIT License
342 stars 52 forks source link

3.4.0 always adds "data-v" attributes, even for non-scoped styles #75

Closed elpres closed 6 years ago

elpres commented 6 years ago

As the title says, even if the style block inside an SFC doesn't have a "scoped" attribute, the resulting DOM will be full of "data-v" attributes. Version 3.3.2 didn't do that yet.

I'm using rollup with the following config:

import resolve from 'rollup-plugin-node-resolve';
import replace from 'rollup-plugin-replace';
import css from 'rollup-plugin-css-only'
import vue from 'rollup-plugin-vue';
import { uglify } from 'rollup-plugin-uglify';
import { minify } from 'uglify-es';

const production = !process.env.ROLLUP_WATCH;

export default {
    input: 'main.js',
    output: {
        file: 'dist/bundle.js',
        format: 'iife',
        sourcemap: true
    },
    plugins: [
        resolve(),
        replace({
            'process.env.NODE_ENV': JSON.stringify(production ? 'production': 'development'),
            'process.env.VUE_ENV': JSON.stringify('browser')
        }),
        css(),
        vue({
            css: false
        }),
        production && uglify({}, minify),
    ]
};