A Plugins for convert variables from css preprocessor file.
English | 中文
$> npm install vite-plugin-vars-modifier -D
#or
$> yarn add vite-plugin-vars-modifier -D
Add following options in vite.config.js
import modifier from 'vite-plugin-vars-modifier';
export default {
plugins: [
modifier({
paths: ['path/to/file'],
type: 'less',
}),
],
};
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';
}
- css-preprocessor-variables -- Convert variables content to json.