Skip to main content

@farmfe/js-plugin-sass

Support sass for Farm.

Installation

Usage

Options

sassOptions

Sass options. See sass options for more details.

Example:

filters

Which files should be processed by sass. Default to { resolvedPaths: ['\\.(s[ac]ss)$'] } for load and { moduleTypes: ['sass'] } for transform.

  • resolvedPaths: Only files under these paths will be processed. Support regex.
  • moduleTypes: Only files with these module types will be processed.

resolvedPaths and moduleTypes are unioned, which means files match any of them will be processed.

Example:

implementation

implementation package name of sass. Default to sass. If you want to use sass-embedded, you can set it to sass-embedded.

note

You should install sass-embedded manually.

additionalData

Additional data to be added to every sass file. Example:

For sass file:

index.scss

additionalData will be added to the top of the file:

index.scss

Function form:

globals

Global sass files. These files will be added to the top of every sass file. It's the same as additionalData but more convenient.

Extremely Fast Web Build Tool Written in Rust

Copyright © 2024 Farm Community. Built with Docusaurus.