egoist / rollup-plugin-postcss

Seamless integration between Rollup and PostCSS.
MIT License
676 stars 217 forks source link

Inclusion of postcss in project causes syntax error #102

Open SumNeuron opened 6 years ago

SumNeuron commented 6 years ago

I was following the JS rollup tutorial at code.lengstorf.com/learn-rollup-css/ which uses postcss. Everything was fine until I tried to include it in my project.

Now I get


[!] SyntaxError: Unexpected token {
SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Module._extensions..js (module.js:417:10)
    at Object.require.extensions..js (<my-project>/node_modules/rollup/bin/rollup:2917:17)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (<my-project>/rollup.config.js:11:31)
    at Module._compile (module.js:410:26)
egoist commented 6 years ago

Can you provide a repo to reproduce this?

SumNeuron commented 6 years ago

@egoist I'll work on it... but it is reproducible by just going through the tutorial and only added packages as needed (rather than cloning his repo and just install the npm modules when stated)

egoist commented 6 years ago

Sorry, I don't have time to read through that tutorial 😂 It would be a lot easier to just clone a repo and run...

Maybe a snippet of the config / app code you're using is enough.

SumNeuron commented 6 years ago

So here is a project that I am working on https://gitlab.com/SumNeuron/multitags which I just incorporated postcss into.

It is currently commented out.

Please do the following to reproduce the error

file: src/scripts/main.js uncomment line 17

file: rollup.config.js uncomment lines 6-14 and 22-30

run ./node_modules/.bin/rollup -c