New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0 to 1.4.1

1

lib/index.d.ts

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

export declare type CachedResult = {
filename: string;
type: string;

@@ -30,0 +29,0 @@ mtimeMs: number;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { OnLoadResult } from "esbuild";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=options.js.map
import { Plugin } from "esbuild";
import { SassPluginOptions } from "./index";
export declare function sassPlugin(options?: SassPluginOptions): Plugin;

23

lib/plugin.js

@@ -50,4 +50,3 @@ "use strict";

return [
type,
(args) => importerMatcher(args.importer) && pathMatcher(path_1.resolve(args.resolveDir, args.path))
type, (args) => importerMatcher(args.importer) && pathMatcher(path_1.resolve(args.resolveDir, args.path))
];

@@ -57,4 +56,3 @@ }

return [
type,
(args) => importerMatcher(args.importer)
type, (args) => importerMatcher(args.importer)
];

@@ -129,9 +127,11 @@ }

if (cached) {
let { filename, type } = cached;
let stats = fs_1.statSync(filename);
if (stats.mtimeMs <= cached.mtimeMs) {
return cached.result;
let watchFiles = cached.result.watchFiles;
let stats = await Promise.all(watchFiles.map(filename => fs_1.promises.stat(filename)));
for (const { mtimeMs } of stats) {
if (mtimeMs > cached.mtimeMs) {
cached.result = await transform(watchFiles[0], cached.type);
cached.mtimeMs = Date.now();
break;
}
}
cached.result = await transform(filename, type);
cached.mtimeMs = stats.mtimeMs;
return cached.result;

@@ -142,4 +142,3 @@ }

let result = await transform(filename, type);
let { mtimeMs } = fs_1.statSync(filename);
group.set(args.path, { filename, type, mtimeMs, result });
group.set(args.path, { type, mtimeMs: Date.now(), result });
return result;

@@ -146,0 +145,0 @@ };

@@ -0,0 +0,0 @@ import { SassPluginOptions } from "./index";

@@ -0,0 +0,0 @@ "use strict";

{
"name": "esbuild-sass-plugin",
"version": "1.4.0",
"version": "1.4.1",
"description": "esbuild plugin for sass/scss files supporting both css loader and css result import (lit-element)",

@@ -55,19 +55,19 @@ "main": "lib/index.js",

"dependencies": {
"esbuild": "^0.12.0",
"picomatch": "^2.2.2",
"sass": "^1.32.8"
"esbuild": "^0.12.4",
"picomatch": "^2.3.0",
"sass": "^1.34.0"
},
"devDependencies": {
"@types/chai": "^4.2.15",
"@types/chai": "^4.2.18",
"@types/chai-string": "^1.4.2",
"@types/mocha": "^8.2.2",
"@types/node": "^15.0.1",
"@types/node": "^15.6.1",
"@types/sass": "^1.16.0",
"chai": "^4.3.4",
"chai-string": "^1.5.0",
"mocha": "^8.3.2",
"mocha": "^8.4.0",
"nyc": "^15.1.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.3"
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
}
}

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

@@ -141,4 +141,2 @@ import {OnLoadResult} from "esbuild";

filename: string
type: string

@@ -152,2 +150,2 @@

export {sassPlugin} from "./plugin";
export {sassPlugin} from "./plugin";
import {Loader, OnLoadArgs, OnLoadResult, OnResolveArgs, Plugin} from "esbuild";
import {readFileSync, statSync} from "fs";
import {promises as fsp, readFileSync} from "fs";
import {dirname, posix, resolve} from "path";

@@ -143,9 +143,11 @@ import picomatch from "picomatch";

if (cached) {
let {filename, type} = cached;
let stats = statSync(filename);
if (stats.mtimeMs <= cached.mtimeMs) {
return cached.result;
let watchFiles = cached.result.watchFiles!;
let stats = await Promise.all(watchFiles.map(filename => fsp.stat(filename)));
for (const {mtimeMs} of stats) {
if (mtimeMs > cached.mtimeMs) {
cached.result = await transform(watchFiles[0], cached.type);
cached.mtimeMs = Date.now();
break;
}
}
cached.result = await transform(filename, type);
cached.mtimeMs = stats.mtimeMs;
return cached.result;

@@ -156,4 +158,3 @@ }

let result = await transform(filename, type);
let {mtimeMs} = statSync(filename);
group.set(args.path, {filename, type, mtimeMs, result});
group.set(args.path, {type, mtimeMs: Date.now(), result});
return result;

@@ -160,0 +161,0 @@ };

Sorry, the diff of this file is not supported yet

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