vuejs / rollup-plugin-vue

Roll .vue files
https://vuejs.github.io/rollup-plugin-vue
MIT License
843 stars 148 forks source link

Examples erroring with latest package versions #430

Open blowsie opened 3 years ago

blowsie commented 3 years ago

Version

5.0.0

Reproduction link

https://codesandbox.io/s/elastic-mcnulty-sr0h1?file=/package.json

Steps to reproduce

What is expected?

Styles to be built properly

What is actually happening?

Styles fail

1:
2: h1 {
       ^
3:   color: red;
4: }
Error: Identifier directly after number (Note that you need plugins to import files that are not JavaScript)
    at error (C:\Projects\ui\node_modules\rollup\dist\shared\rollup.js:5240:30)
    at Module.error (C:\Projects\ui\node_modules\rollup\dist\shared\rollup.js:9932:16)
    at tryParse (C:\Projects\ui\node_modules\rollup\dist\shared\rollup.js:9791:23)
    at Module.setSource (C:\Projects\ui\node_modules\rollup\dist\shared\rollup.js:10239:19)
    at ModuleLoader.addModuleSource (C:\Projects\ui\node_modules\rollup\dist\shared\rollup.js:18524:20)
ckvv commented 3 years ago

Why is no one responding after so long?

derrickb commented 3 years ago

A way to mitigate this error is to have the PostCSS or CSS plugins in your plugin array. Hope this gets cleared up so this dependency is no longer necessary.

import vue from 'rollup-plugin-vue';
import css from 'rollup-plugin-css-only';
...
plugins: [
  vue(),
  css()
]