thgh / rollup-plugin-scss

Rollup and compile multiple .scss, .sass and .css imports
MIT License
134 stars 47 forks source link

Unexpected token error w/ Rollup 1.12.0 #31

Closed andrewpile closed 5 years ago

andrewpile commented 5 years ago

After upgrading from rollup 1.11.3 to 1.12.0 it looks like rollup no longer parses SCSS files correctly:

> rollup -c build/sass.js

src/sass/index.js → stdout...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src/sass/normalize.scss (14:5)
12:  */
13:
14: html {

I'm using the typical method of including sass files with JS import:

export default {
    input: 'src/sass/index.js',
    plugins: [
        scss({
            output: 'src/public/css/base.css',
            outputStyle: 'compressed',
            ...
        })
    ],
    output: {
        format: 'cjs'
    }
}

index.js:

import './normalize.scss'
import './base.scss'

...

export default {}

I dug into this a little, but https://github.com/rollup/rollup/releases/tag/v1.12.0 shows as "no breaking changes", so it's no obvious to someone who isn't familiar with rollup's plugin internals.

andrewpile commented 5 years ago

Happy to report this is fixed in v1.12.1!

mattdillon100 commented 3 years ago

I am still getting this issue in rollup v2.39.1