esbuild-plugin-sass
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -112,3 +112,4 @@ "use strict"; | ||
// Compile SASS to CSS | ||
let css = (await sassRender({ ...customSassOptions, file: sourceFullPath })).css.toString(); | ||
const sassRenderResult = await sassRender({ ...customSassOptions, file: sourceFullPath }); | ||
let css = sassRenderResult.css.toString(); | ||
// Replace all relative urls | ||
@@ -120,3 +121,3 @@ css = await replaceUrls(css, tmpFilePath, sourceDir, rootDir, external_1.compilePatterns(external)); | ||
path: tmpFilePath, | ||
watchFiles: [sourceFullPath], | ||
watchFiles: sassRenderResult.stats.includedFiles, | ||
}; | ||
@@ -123,0 +124,0 @@ }); |
{ | ||
"name": "esbuild-plugin-sass", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Plugin for esbuild to support SASS styles", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,7 +5,7 @@ # esbuild-plugin-sass | ||
Plugin for [esbuild](https://esbuild.github.io/) to support SASS styles | ||
Plugin for [esbuild](https://esbuild.github.io/) to support Sass style sheets | ||
## Install | ||
```bash | ||
```shell | ||
npm i esbuild esbuild-plugin-sass | ||
@@ -29,3 +29,3 @@ ``` | ||
```js | ||
import './test.scss' | ||
import "./test.scss"; | ||
``` | ||
@@ -36,11 +36,13 @@ | ||
```js | ||
const esbuild = require('esbuild'); | ||
const sassPlugin = require('esbuild-plugin-sass') | ||
const esbuild = require("esbuild"); | ||
const sassPlugin = require("esbuild-plugin-sass"); | ||
esbuild.build({ | ||
entryPoints: ['src/index.js'], | ||
esbuild | ||
.build({ | ||
entryPoints: ["src/index.js"], | ||
bundle: true, | ||
outfile: 'bundle.js', | ||
outfile: "bundle.js", | ||
plugins: [sassPlugin()], | ||
}).catch((e) => console.error(e.message)) | ||
}) | ||
.catch((e) => console.error(e.message)); | ||
``` | ||
@@ -50,4 +52,4 @@ | ||
```bash | ||
node build.js | ||
```console | ||
$ node build.js | ||
``` | ||
@@ -71,7 +73,7 @@ | ||
interface Options { | ||
rootDir?: string | ||
customSassOptions?: Omit<sass.Options, 'file'> | ||
rootDir?: string; | ||
customSassOptions?: Omit<sass.Options, "file">; | ||
} | ||
export = (options: Options = {}) => Plugin | ||
export = (options: Options = {}) => Plugin; | ||
``` | ||
@@ -81,4 +83,3 @@ | ||
- `rootDir` - folder to resolve pathes against | ||
- `rootDir` - folder to resolve paths against | ||
- `customSassOptions` - options object passed to `sass` [render](https://sass-lang.com/documentation/js-api#render) function, except `file` option, which is overriden by plugin for each processed file |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10765
172
80