Skip to content

Craco plugin to use sass-resources-loader in create react app & craco v5+

License

Notifications You must be signed in to change notification settings

AndrewAntoniuk/craco-sass-resources-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Craco sass-resources-loader

MIT License

This is a craco plugin to add sass-resources-loader with create-react-app version >= 5.

Installation

$ yarn add -D craco-sass-loader

# OR

$ npm install craco-sass-loader --save-dev

Usage

craco-sass-loader expect a resources option containing a string or an array of string pointing the scss files your want to load before any scss/sass file.

const sassResourcesLoader = require('craco-sass-loader');

module.exports = {
  plugins: [
    {
      plugin: sassResourcesLoader,
      options: {
        resources: './src/my-config-theme.scss',
      },
    },
  ],
}

You can load multiple scss resources files too:

const sassResourcesLoader = require('craco-sass-loader');

module.exports = {
  plugins: [
    {
      plugin: sassResourcesLoader,
      options: {
        resources: [
          './src/my-config-theme.scss',
          './src/my-other-config-theme.scss'
        ],
      },
    },
  ],
}

About

Craco plugin to use sass-resources-loader in create react app & craco v5+

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%