sveltejs/rollup-plugin-svelte

[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript) error introduced with version 7.0.0

jordan112 opened this issue · 4 comments

I'm currently using version 6.1.1 and it works fine. When I install 7.0.0, I get the following error.

src/main.js → public/build, public/build/nomodule...
[!] Error: Unexpected character '@' (Note that you need plugins to import files that are not JavaScript)
src/shared/layout/Page.css (1:0)

I'm not clear what the issue is and I'm not able to locate any issues in my code that would cause this issue.

I've tested this out with a vanilla rollup.config and I get the same issue.

This appears to relate the this setting

    // Emit CSS as "files" for other plugins to process. default is true
      emitCss: false,

By default, it's true, but if I set it to false, it builds fine with no error

As described in the readme, you need another plugin to handle the CSS as of v7.

Thank you @Conduitry. I had read the readme but I wasn't clear on that part. I'm able to add

postcss({
      plugins: []
    }),

and it works fine now. FYI for any future devs.

It's also in the Changelog FYI