1.1.18 • Published 7 months ago

@pieced/babel-plugin-auto-css-modules v1.1.18

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Automatically identify CSS Modules

Install

npm i @pieced/babel-plugin-auto-css-modules

Usage

import styles from 'a.scss'; //===>import styles from 'a.scss?modules'

Without options:

{
  "plugins": [
    "@pieced/babel-plugin-auto-css-modules"
  ]
}

With options:

{
  "plugins": [
    [
      "@pieced/babel-plugin-auto-css-modules",
      {
        "generate": "function"
      }
    ]
  ]
}

Options

generate type function

(value, suffix) => {
  const CSS_EXT_NAMES = ['.css', '.less', '.sass', '.scss', '.stylus', '.styl'];
  if (CSS_EXT_NAMES.includes(suffix)) return `${value}?modules`;
}
// return import styles from 'a.scss?modules'
1.1.1

9 months ago

1.1.0

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.15-beta.0

9 months ago

1.1.12

9 months ago

1.1.11

9 months ago

1.1.10

9 months ago

1.1.16

8 months ago

1.1.15

9 months ago

1.1.14

9 months ago

1.1.13

9 months ago

1.1.18

7 months ago

1.1.17

8 months ago

1.0.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.0

4 years ago