Skip to content

huaxiabuluo/babel-plugin-package-css-module

Repository files navigation

babel-plugin-package-css-module

About

Compile and use css module in npm package

  • only support less module now
  • less module files should end with .module.less

Example

/** .babelrc */
{
  "presets": [
    ...
  ],
  "plugins": [
    ["package-css-module", { "entry": "src", "output": ["lib", "es"] }],
    ...
  ]
}
/** src/index.js */
import styles from './index.module.less';

           

/**
 * es/index.js
 * 
 * src/index.module.less
 * ↓ ↓ ↓ ↓ ↓ ↓
 * es/index.module.css
 * es/index.module.css.js
 */
import './index.module.css';
import styles from './index.module.css.js';

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published