1.1.18 • Published 8 months ago

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

Weekly downloads
-
License
MIT
Repository
-
Last release
8 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

10 months ago

1.1.0

10 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.15-beta.0

10 months ago

1.1.12

10 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.1.16

9 months ago

1.1.15

10 months ago

1.1.14

10 months ago

1.1.13

10 months ago

1.1.18

8 months ago

1.1.17

9 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