2.7.1 • Published 19 days ago

@farmfe/js-plugin-sass v2.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
19 days ago

Sass Plugin for Farm

Support compiling Sass/Scss in Farm.

Usage

Install @farmfe/js-plugin-sass by your favorite package manager(npm, yarn, pnpm and so on):

npm i @farmfe/js-plugin-sass --save-dev # or pnpm/yarn add @farmfe/js-plugin-sass -D

Configuring the plugin in farm.config.ts:

import { defineFarmConfig } from '@farmfe/core/dist/config';
import Sass from '@farmfe/js-plugin-sass'; //  import the plugin

export default defineFarmConfig({
  compilation: {
    input: {
      index: './index.html',
    },
    output: {
      path: './build',
    },
  },
  plugins: [
    // use the sass plugin.
    Sass({
      // custom options here
    }),
  ],
});

Options

implementation

Type: string | undefined

Default: undefined

Specify the executor of the sass file (such as sass, sass-embedded), if not defined, the file in node_module will be searched by default.

match

Type: string[]

Default: ["\\.s[ac]ss$"]

Specifies the matching files.

globals

Type: string[]

Default: []

Reads the contents from a file and injects them into each sass/scss file. It is typically used to inject some global variables

Note that normal css should not be written in this file, otherwise it will inject them repeatedly into each compiled css file

content

Type: string | undefined

Default: undefined

It has the same function as globals, but it can be conveniently used to inject some simple sass/scss content

sourceMap

Type: boolean

Default: false

Whether to generate sourceMap

If not set, it will read the compilation.sourcemap configuration in the farm configuration

sassOption

Type: StringOptions<'async'>

Default: {}

2.7.1

19 days ago

2.7.0

21 days ago

2.6.0

1 month ago

2.5.4

1 month ago

2.5.3

1 month ago

2.5.2

2 months ago

2.5.1

2 months ago

2.5.0

2 months ago

2.4.0

4 months ago

2.3.0

4 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

2.1.2

6 months ago

2.0.3

7 months ago

2.2.0

6 months ago

2.1.1

6 months ago

2.0.2

8 months ago

2.0.4

7 months ago

2.1.0

7 months ago

2.0.1

8 months ago

2.0.0

10 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.0

1 year ago

0.0.2

1 year ago