Version
6.0.0-beta.6
Reproduction link
https://stackoverflow.com/questions/62384191/rollup-vue-and-buble-unexpected-token-in-scss-file/62625441#62625441
Steps to reproduce
6.0.0-beta.6. (was unable to fill that into the "version" field)
As @P-Seebauer mentions here,
the css needs an extra rollup css plugin, this is awkward because the css-only plugin seems like the wrong choice at first (“i have scss”),
That ticket is closed, but this anomaly remains. Thus the creation of this ticket, to track it.
Setup
Vue.js 3 (beta), e.g. 3.0.0-beta.15
Rollup 2.16.1
rollup-plugin-vue 6.0.0-beta.6
Expectation:
It is easy to build a Vue.js 3 (beta) project, using Rollup.
Actual:
One gets the following error message, and it is not clear a) what causes it, b) how to get rid of it:
$ npx rollup -c
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src/App.vue?vue&type=style&index=0&id=7ba5bd90&scoped=true&lang.css (2:0)
First aid
The way around this was suggested by @P-Seebauer's comment (above). I added rollup-plugin-scss to the mix, and it seems to please Rollup. The build proceeds. It handles both .scss and .css files.
However, since Vue.js is expected to handle these, asking application developers to add such a plugin seems unnecessary.
Real fix
I cannot say, whether this falls to Vue.js 3 beta or the rollup-plugin-vue (also beta) domain. I do hope it gets ironed out, before the both are out of their betas.
What is expected?
Things "just work", without needing to add rollup-plugin-scss, to handle Vue styles.
What is actually happening?
One needs to add that plugin.
I can be of assistance in testing.