rpg
@montagejs/rollup-plugin-generate-style
npm i @montagejs/rollup-plugin-generate-style
rpg

@montagejs/rollup-plugin-generate-style

Montage, For FE Montage~

by Eric(书生)

0.0.8 (see all)License:ISCTypeScript:Not Found
npm i @montagejs/rollup-plugin-generate-style
Readme

@montagejs/rollup-plugin-generate-style

A rollup plugin, mainly used to generate automatic import js file generation of css, less and sass.

Born for babel-plugin-import~

Usage

$ npm i @montagejs/rollup-plugin-generate-style --save-dev
import gStyle from '@montagejs/rollup-plugin-generate-style';

export default {
    plugins: [
        gStyle()
    ]
}

As shown below, we can see that an index.js file is generated in the style directory, which will automatically import index.css to serve babel-plugin-import.

.
📦package-xxx
    ┣ 📂es
    ┣  ┗ 📂style
    ┃     ┗ 📜index.css
    ┣  ┗ 📜index.js
    ┣ 📂lib
    ┃  ┗ 📂style
    ┃     ┗ 📜index.css
    ┃  ┗ 📜index.js
    ┣ 📂node_modules
    ┣ 📂src
    ┃  ┗ 📜index.tsx
    ┃  ┗ 📜index.less
    ┣ 📜.gitignore
    ┗ 📜package.json
    
          ↓ ↓ ↓ ↓ ↓ ↓

.
📦package-xxx
    ┣ 📂es
    ┣  ┗ 📂style
    ┃     ┗ 📜index.css
    ┃     ┗ 📜index.js(`import './index.css'`)
    ┣  ┗ 📜index.js
    ┣ 📂lib
    ┃  ┗ 📂style
    ┃     ┗ 📜index.css
    ┃     ┗ 📜index.js(`import './index.css'`)
    ┃  ┗ 📜index.js
    ┣ 📂node_modules
    ┣ 📂src
    ┃  ┗ 📜index.tsx
    ┃  ┗ 📜index.less
    ┣ 📜.gitignore
    ┗ 📜package.json
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate