0.0.1 • Published 3 years ago

babel-plugin-smart-css-modules v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

babel-plugin-smart-css-modules

Automatic recognition of CSS Modules.

InputOutput
import './index.scss'import './index.scss'
import _ from './index.css'import _ from './index.css?modules'
import _ from './index.scss'import _ from './index.scss?modules'
import _ from './index.less'import _ from './index.less?modules'

Support

FrameworkSupport
Vue CLI Native
UmiJS Native

Install

npm i babel-plugin-smart-css-modules -D

Usage

Add babel-plugin-smart-css-modules to babel.config.js:

module.exports = {
  plugins: [
    require('babel-plugin-smart-css-modules').useSmartCssModules({
      // options
    }),
  ],
}

Options

ParameterTypeDescriptionExampleDefault
extsstring[]The supported extensions.['.css', '.less', '.sass', '.scss', '.stylus', '.styl']
flagstringThe query flag to identify CSS Modules.modules
ignoreRegExpThe RegExp of the ignored files./_variables\.scss$/

License

MIT (c) Jay Fong