Socket
Socket
Sign inDemoInstall

react-app-rewire-xss-modules

Package Overview
Dependencies
431
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-app-rewire-xss-modules

Add [CSS Module](https://github.com/css-modules/css-modules) loaders to your [create-react-app](https://github.com/facebookincubator/create-react-app) via [react-app-rewired](https://github.com/timarney/react-app-rewired).


Version published
Weekly downloads
1
Maintainers
1
Install size
157 kB
Created
Weekly downloads
 

Readme

Source

from react-app-rewire-css-modules@1.0.0

change index.js add less Support && repair sass/scss Support

react-app-rewire-css-modules

Add CSS Module loaders to your create-react-app via react-app-rewired.

CSS Module styles can be written in CSS or SASS.

Installation

This package is not yet published to the npm registry. Install from GitHub:

yarn add --dev codebandits/react-app-rewire-css-modules sass-loader node-sass

OR

npm install --save-dev codebandits/react-app-rewire-css-modules sass-loader node-sass

Usage

Use the following file extensions for any CSS Modules styles:

  • *.module.css
  • *.module.sass
  • *.module.scss

Files with the following file extensions will load normally, without the CSS Modules loader:

  • *.css
  • *.sass
  • *.scss

Example

In your react-app-rewired configuration:

/* config-overrides.js */

const rewireCssModules = require('react-app-rewire-css-modules');

module.exports = function override(config, env) {
    // ...
    config = rewireCssModules(config, env);
    // ...
    return config;
}

In your React application:

// src/App.module.scss

.app {
  color: aqua;
  
  &:hover {
    color: lawngreen;
  }
}
// src/App.js

import React from 'react';
import styles from './App.module.scss';

export default ({text}) => (
    <div className={styles.app}>{text}</div>
)

FAQs

Last updated on 17 Jun 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc