From a4c2e3f6b7c2dd2c4b53dfbbdfcbeecd0796c635 Mon Sep 17 00:00:00 2001 From: Day Date: Fri, 5 Jun 2020 07:59:55 +0800 Subject: [PATCH] docs: css preprocess options --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 47dbde901a8a02..1712e2c49f854a 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,24 @@ Or import them from JavaScript: import './style.scss' ``` +#### Passing Options to Pre-Processor + +> 0.20.3+ + +And if you want to pass options to the pre-processor, you can do that using the `cssPreprocessOptions` option in the config (see [Config File](#config-file) below). +For example, to pass some shared global variables to all your Less styles: + +```js +// vite.config.js +module.exports = { + cssPreprocessOptions: { + modifyVars: { + 'preprocess-custom-color': 'green' + } + } +} +``` + ### JSX `.jsx` and `.tsx` files are also supported. JSX transpilation is also handled via `esbuild`.