5

I've created nuxt project vue init nuxt/starter <project-name>

In my nuxt.config.js I added this:

css: [
        { src: '~assets/css/style.css', lang: 'css' }
    ]

and in my assets/css folder I have style.css with

body {
    background: black!important;
}

But nothing happens with no errors on console. what to I do?

1
  • 1
    I just tested and it works fine me... What version of Nuxt do you use ? Commented Aug 2, 2017 at 23:16

1 Answer 1

9

you must add to nuxt.config.js

build: {
        extractCSS: true
    }

For example,

css: [
        { src: '~assets/css/style.css', lang: 'css' }
    ],
build: {
            extractCSS: true
        }

And use nuxt v0.10.6

Sign up to request clarification or add additional context in comments.

2 Comments

This is what I was looking for! However, where in the documentation is written about extractCSS? Please indicate to me.

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.