@originjs/vite-plugin-global-style v1.0.3
vite-plugin-global-style
CSS, SASS, LESS, Stylus files named starting with global are automatically added to the vite global style.
For global CSS styles, they will be added to the index.html and will affect all pages.
For global SASS/LESS/Stylus styles, they will be added to every SASS/LESS files using @import XXXX.
Install
npm install @originjs/vite-plugin-global-style --save-devor
yarn add @originjs/vite-plugin-global-style --devUsage
add @originjs/vite-plugin-global-style in vite.config.js.
import globalStyle from '@originjs/vite-plugin-global-style'
export default {
plugins: [
globalStyle(
/* options */
)
]
}Options
sourcePath- Type:
string - Default:
src/assets
The relative path of the directory in which to search for global styles.
- Type:
cssEnabled- Type:
boolean - Default:
true
Whether to automatically load the
CSSglobal styles.- Type:
sassEnabled- Type:
boolean - Default:
true
Whether to automatically load the
SASSglobal styles.- Type:
lessEnabled- Type:
boolean - Default:
true
Whether to automatically load the
LESSglobal styles.- Type:
stylusEnabled- Type:
boolean - Default:
true
Whether to automatically load the
Stylusglobal styles.- Type:
recursive- Type:
boolean - Default:
true
Whether to recursively search the global styles in the
sourcePathdirectory.- Type: