Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

esbuild-sass-plugin

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-sass-plugin - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

1

lib/index.d.ts

@@ -5,2 +5,3 @@ import { OnLoadResult } from "esbuild";

export declare type SassPluginOptions = {
exclude?: RegExp;
implementation?: string;

@@ -7,0 +8,0 @@ basedir?: string;

@@ -111,8 +111,17 @@ "use strict";

}
function useExclude(callback) {
const exclude = options.exclude;
if (exclude) {
return (args) => exclude.test(args.path) ? null : callback(args);
}
else {
return callback;
}
}
return {
name: "sass-plugin",
setup: function (build) {
build.onResolve({ filter: /\.(s[ac]ss|css)$/ }, (args) => {
build.onResolve({ filter: /\.(s[ac]ss|css)$/ }, useExclude((args) => {
return { path: args.path, namespace: "sass", pluginData: args };
});
}));
let cached;

@@ -119,0 +128,0 @@ if (cache) {

2

package.json
{
"name": "esbuild-sass-plugin",
"version": "1.4.3",
"version": "1.4.4",
"description": "esbuild plugin for sass/scss files supporting both css loader and css result import (lit-element)",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -88,2 +88,3 @@ ![logo created with https://cooltext.com](https://images.cooltext.com/5500652.png)

|transform|function|undefined|
|exclude|regex|undefined|

@@ -114,2 +115,15 @@

### Exclude Option
Used to exclude paths from the plugin
e.g.
```javascript
await esbuild.build({
...
plugins: [sassPlugin({
exclude: /^http:\/\//, // ignores urls
})]
})
```
### Transform Option

@@ -116,0 +130,0 @@ ```typescript

@@ -9,2 +9,7 @@ import {OnLoadResult} from "esbuild";

/**
*
*/
exclude?: RegExp;
/**
* "sass" for dart-sass (compiled to javascript, slow) or "node-sass" (libsass, fast yet deprecated)

@@ -11,0 +16,0 @@ * You can pass the module name of any other implementation as long as it is API compatible

@@ -130,2 +130,11 @@ import {Loader, OnLoadArgs, OnLoadResult, OnResolveArgs, Plugin} from "esbuild";

function useExclude(callback) {
const exclude = options.exclude;
if (exclude) {
return (args: OnResolveArgs) => exclude.test(args.path) ? null : callback(args)
} else {
return callback
}
}
return {

@@ -135,5 +144,5 @@ name: "sass-plugin",

build.onResolve({filter: /\.(s[ac]ss|css)$/}, (args) => {
build.onResolve({filter: /\.(s[ac]ss|css)$/}, useExclude((args) => {
return {path: args.path, namespace: "sass", pluginData: args};
});
}));

@@ -140,0 +149,0 @@ let cached: (

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc