davibe / next.js-example-with-global-stylesheet

Next.js example for including a global stylesheet with HMR
91 stars 15 forks source link

Any way to externalize and minify the CSS generated? #10

Open amitsch666 opened 7 years ago

amitsch666 commented 7 years ago

Following your instruction I am able to compile a Sass stylesheet into vanilla CSS and and have it injected into the component's tag. However, I am looking to have the generated CSS exported to a separate file with a referencing it injected instead of the inline CSS. Is that even possible? In non-Next projects, I would use the ExtractText plugin to achieve this result, not sure if that would work in next.config.js.

eliot-akira commented 7 years ago

This is the same issue as #6, how to use external stylesheet in production. I'd love to see this supported too, to avoid bundling the compiled CSS in JS files. I feel that it's a necessary feature for production use of Sass in Next.js projects.