Is there any way to use sass instead of node-sass (default for sass-loader) in Nuxt.js?

痞子三分冷 提交于 2020-05-18 04:30:09

问题


I'm trying to use sass package instead of node-sass in Nuxt.js. I found a config like this;

// vue.config.js
module.exports = {
  css: {
    loaderOptions: {
      sass: {
        implementation: require('sass'), // This line must in sass option
      },
    },
  }
}

but I couldn't figure out where to put this code in Nuxt.js.


回答1:


Its already pointed on documentation.

nuxt.config.js:

build: {

  ...

  loaders: {
    sass: {
      implementation: require('sass')
    },
    scss: {
      implementation: require('sass')
    }
  }

  ...

}


来源:https://stackoverflow.com/questions/57249076/is-there-any-way-to-use-sass-instead-of-node-sass-default-for-sass-loader-in-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!