S
S
Sergei Gurdjiyan2018-03-08 12:20:26
webpack
Sergei Gurdjiyan, 2018-03-08 12:20:26

How to include and compile global sass file in Nuxt.js?

How to include a global sass stylesheet to a template and compile it to Nuxt.js?
Found only how to import into each component, but this is not an option.
Plus it is not clear how to compile it in such a project.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Orlov, 2018-03-08
@mrKorg

Like this

S
Sergey Peskov, 2019-06-21
@SergeyPeskov

Run
npm i @nuxtjs/style-resources -D
And add to nuxt.config.js

module.exports = { 
  modules: [
    '@nuxtjs/style-resources',
  ],
  styleResources: {
   sass: [
    '~/assets/globals.sass', // путь к вашему файлу
   ],
  },
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question