LoginSignup
0
0

More than 3 years have passed since last update.

Gatsby.jsでSassを導入する手順

Posted at

Gatsby.jsでSassを導入する手順になります。

gatsby-plugin-sassを導入する

Gatsby.jsでSassを使用するには、プラグインを導入します。

# npm
npm install node-sass gatsby-plugin-sass
# yarn
yarn add node-sass gatsby-plugin-sass

gatsby-config.jsで設定をする

gatsby-config.js
module.exports = {
  /* Your site config here */
  plugins: ["gatsby-plugin-sass"],
}

gatsby-config.jsで、上記のように読み込みます。

これでGatsby.jsでSassが使用可能になります。

※node-sassのバージョンによってエラーが出る場合があります。
Gatsby.js 【Node Sass version 5.0.0 is incompatible with ^4.0.0.】 エラーの対処法

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0