5

How can I convert inline-CSS to CSS-files in nuxt.js? I have both scoped styles and global scss file in my app. I have already tried below code but no luck.

build: {
    optimization: {
      splitChunks: {
        chunks: 'all',
        automaticNameDelimiter: '.',
        name: 'rameez',
        cacheGroups: {}
      }
    },
    optimizeCSS:true
  }

here you can see all the CSS including my global.scss is shown as an inline style.

enter image description here

1 Answer 1

8

You are looking for extractCss property i think

build:{
    extractCSS: true
}
Sign up to request clarification or add additional context in comments.

3 Comments

I was already using extractCSS: true but was checking the output in dev mode.. that made me confuse, I think it extracts CSS in prod mode by default. anyway thanks.
@RameezRami yes, it wont work on dev. But no, on prod it default to false too, u need to set it yourself
yes that's why I said I was already using extractCSS: true :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.