JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q51360F
  • License MIT

vite support for modular-css

Package Exports

  • @modular-css/vite
  • @modular-css/vite/vite.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@modular-css/vite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@modular-css/vite NPM Version NPM License NPM Downloads

Vite support for modular-css.

Install

> npm i @modular-css/vite

Usage

// vite.config.js
import mcss from "@modular-css/vite";

export default {
    plugins : [
        mcss()
    ]
};

Options

include/exclude

A minimatch pattern, or an array of minimatch patterns, relative to process.cwd(). include defaults to **/*.css.

processor

Pass an already-instantiated Processor instance to the vite plugin. It will then add any files found when traversing the modules to it and both the vite-discovered and any already-existing files will be output in the final CSS.

styleExport

You can disable returning the style string, eg import { styles } from "./style.css";, by setting styleExport to false. Defaults to true.

defaultExport

You can disable exporting classes as default export, eg import styles from "./style.css";, by setting defaultExport to false. Defaults to true.

variableDeclaration

You can set variable declaration kind, eg var mc_rule = ...;, by setting variableDeclaration to var. Defaults to const.

Shared Options

All other options are passed to the underlying Processor instance, see the Processor Options.