vite-plugin-vars-modifier
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

vite-plugin-vars-modifier

A Plugins for convert variables from css preprocessor file.


English | 中文

Usage

Install

$> npm install vite-plugin-vars-modifier -D
#or
$> yarn add vite-plugin-vars-modifier -D

Use

Add following options in vite.config.js

import modifier from 'vite-plugin-vars-modifier';

export default {
    plugins: [
        modifier({
            paths: ['path/to/file'],
            type: 'less',
        }),
    ],
};

Options

export interface ModifierOptions {
    /**
     * paths for content to pass to parser.
     *
     * support glob format
     *
     * @see https://github.com/mrmlnc/fast-glob#readme
     */
    paths: string | string[];

    /**
     * Whether to remove the prefix
     *
     * @default true
     */
    strip: boolean;

    /**
     * Typeof parser of modifier
     */
    type: 'less' | 'scss';
}

relation

License

MIT

Package Sidebar

Install

npm i vite-plugin-vars-modifier

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

8.43 kB

Total Files

9

Last publish

Collaborators

  • fanhaoyuan