@dubortoto/craco-sass-resources-loader
v1.0.0
Published
A craco plugin to use sass-resources-loader with create-react-app
Downloads
10
Maintainers
Readme
Craco sass-resources-loader
Modify with tilap/craco-sass-resources-loader
This is a craco plugin to add sass-resources-loader with create-react-app version >= 2.
Installation
$ yarn add -D @jonny1994/craco-sass-resources-loader
# OR
$ npm install @jonny1994/craco-sass-resources-loader --save-dev
Usage
craco-sass-resources-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('@jonny1994/craco-sass-resources-loader');
module.exports = {
plugins: [
{
plugin: sassResourcesLoader,
options: {
hoistUseStatements: false,
resources: './src/my-config-theme.scss',
},
},
],
}
You can load multiple scss resources files too:
const sassResourcesLoader = require('craco-sass-resources-loader');
module.exports = {
plugins: [
{
plugin: sassResourcesLoader,
options: {
resources: [
'./src/my-config-theme.scss',
'./src/my-other-config-theme.scss'
],
},
},
],
}