Socket
Book a DemoInstallSign in
Socket

@originjs/vite-plugin-global-style

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@originjs/vite-plugin-global-style

A vite plugin that help you handle with global styles

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
211
-26.99%
Maintainers
5
Weekly downloads
 
Created
Source

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-dev

or

yarn add @originjs/vite-plugin-global-style --dev

Usage

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.

  • cssEnabled

    • Type: boolean
    • Default: true

    Whether to automatically load the CSS global styles.

  • sassEnabled

    • Type: boolean
    • Default: true

    Whether to automatically load the SASS global styles.

  • lessEnabled

    • Type: boolean
    • Default: true

    Whether to automatically load the LESS global styles.

  • stylusEnabled

    • Type: boolean
    • Default: true

    Whether to automatically load the Stylus global styles.

  • recursive

    • Type: boolean
    • Default: true

    Whether to recursively search the global styles in the sourcePath directory.

FAQs

Package last updated on 18 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts