craco-style-resources-loader

1.2.2 • Public • Published

Craco style-resources-loader

MIT License

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

Inspired by: https://github.com/tilap/craco-sass-resources-loader

Installation

$ yarn add -D craco-style-resources-loader

# OR

$ npm install craco-style-resources-loader --save-dev

Usage

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

const stylesResourcesLoader = require('craco-style-resources-loader');

module.exports = {
  plugins: [
    {
      plugin: stylesResourcesLoader,
      options: {
        patterns: './src/variables.css',
      },
    },
  ],
}

You can load multiple CSS files too:

const stylesResourcesLoader = require('craco-style-resources-loader');

module.exports = {
  plugins: [
    {
      plugin: stylesResourcesLoader,
      options: {
        patterns: [
          './src/global-variables.css',
          './src/theme-variables.css'
        ],
      },
    },
  ],
}

Package Sidebar

Install

npm i craco-style-resources-loader

Weekly Downloads

23

Version

1.2.2

License

MIT

Unpacked Size

2.24 MB

Total Files

8

Last publish

Collaborators

  • spacedawwwg