thgh / rollup-plugin-scss

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

[Bug] node-sass incompatible with MDC #41

Closed Pk13055 closed 4 years ago

Pk13055 commented 4 years ago

Here's the traceback:

src/index.js → dist/bundle.js...
[!] (plugin css) Error: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"
Error: Invalid CSS after "@include mixins": expected 1 selector or at-rule, was ".core-styles;"
    at Object.module.exports.renderSync (./node_modules/node-sass/lib/index.js:441:16)
    at compileToCSS (./node_modules/rollup-plugin-scss/index.cjs.js:23:40)
    at Object.generateBundle (./node_modules/rollup-plugin-scss/index.cjs.js:88:17)
    at ./node_modules/rollup/dist/shared/node-entry.js:13113:25
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)

Here's the rollup.config.js:

import svelte from 'rollup-plugin-svelte'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import serve from 'rollup-plugin-serve'
import scss from 'rollup-plugin-scss'

export default {
    input: 'src/index.js',
    output: {
        //  sourcemap: true,
        file: 'dist/bundle.js',
        format: 'iife',
        name: 'app'
    },
    plugins: [
        svelte({
            dev: true,
            emitCss: true,
        }),
        resolve(),
        commonjs(),
        scss({
            output: 'dist/bundle.css',
            failOnError: true
        }),
        serve({
            contentBase: 'dist',
            verbose: true,
            host: '0.0.0.0',
            port: 8000,
            headers: {'Access-Control-Allow-Origin': '*'}
        })
    ],
    watch: {
        clearScreen: false
    }
}
Pk13055 commented 4 years ago

39 will help fix a lot of the issues, inspite of some sacrificed speed

Pk13055 commented 4 years ago

Also, Screenshot from 2020-02-19 02-54-48

Pk13055 commented 4 years ago

Okay so turns out it works with node-8. There's a dockerized version of the app at pk13055/svelte-template:latest