Suppress css modules while import/require css/less/sass modules in js file.
Install
npm install --save-dev babel-plugin-suppress-css-modules
Usage
configure .babelrc
file
{
"env": {
"server": {
"plugins": [
["suppress-css-modules", {
extensions: [".css", ".less", ".scss"]
}]
]
}
}
}
source file src.js
import "./css.css";
import "./less.less";
import "./scss.scss";
const k = (x) => {};
function xx() {}
xx();
k("x");
require("./css1.css");
const x = require("./less1.less");
output file output.js
"use strict";
var k = function k(x) {};
function xx() {}
xx();
k("x");