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

gulp-dart-scss

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-dart-scss - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

86

index.js
const through2 = require("through2");
const pluginError = require("plugin-error");
const dartSass = require("dart-sass");
const dartSass = require("sass");
const applySourceMap = require("vinyl-sourcemaps-apply");

@@ -8,51 +8,51 @@ const path = require("path");

module.exports = (options = {}) => {
return through2.obj((file, encoding, callback) => {
if (file.isNull()) {
return callback(null, file);
}
return through2.obj((file, encoding, callback) => {
if (file.isNull()) {
return callback(null, file);
}
if (file.isStream()) {
return callback(
new pluginError("gulp-dart-scss", "Streaming not supported")
);
}
if (file.isStream()) {
return callback(
new pluginError("gulp-dart-scss", "Streaming not supported")
);
}
// Ignore _name.scss files
if (path.basename(file.path).indexOf("_") === 0) {
return callback();
}
// Ignore _name.scss files
if (path.basename(file.path).indexOf("_") === 0) {
return callback();
}
(async () => {
try {
options.sourceMap = file.sourceMap ? file.path : false;
options.file = file.path || options.file;
(async () => {
try {
options.sourceMap = file.sourceMap ? file.path : false;
options.file = file.path || options.file;
const result = await dartSass.renderSync(options);
file.contents = Buffer.from(result.css);
const result = await dartSass.renderSync(options);
file.contents = Buffer.from(result.css);
// Replace .scss with .css
file.path = path.join(
path.dirname(file.path),
path.basename(file.path, path.extname(file.path)) + ".css"
);
// Replace .scss with .css
file.path = path.join(
path.dirname(file.path),
path.basename(file.path, path.extname(file.path)) + ".css"
);
// Apply sourcemap if gulp-sourcemap is present
if (result.map && file.sourceMap) {
const map = JSON.parse(result.map);
map.file = file.relative;
map.sources = map.sources.map(source =>
path.relative(file.base, source)
);
applySourceMap(file, map);
}
// Apply sourcemap if gulp-sourcemap is present
if (result.map && file.sourceMap) {
const map = JSON.parse(result.map);
map.file = file.relative;
map.sources = map.sources.map(source =>
path.relative(file.base, source)
);
applySourceMap(file, map);
}
setImmediate(callback, null, file);
} catch (error) {
process.stderr.write(
`${new pluginError("gulp-dart-scss", error.message).toString()} \r\n`
);
return callback();
}
})();
});
setImmediate(callback, null, file);
} catch (error) {
process.stderr.write(
`${new pluginError("gulp-dart-scss", error.message).toString()} \r\n`
);
return callback();
}
})();
});
};
{
"name": "gulp-dart-scss",
"version": "1.0.3",
"description": "Gulp plugin to compile Sass using the Dart Sass compiler.",
"author": "Kasper Hesthaven",
"repository": "kasperhesthaven/gulp-dart-scss",
"license": "MIT",
"main": "index.js",
"engines": {
"node": ">=7"
},
"keywords": [
"dartsass",
"gulpplugin",
"sass"
],
"dependencies": {
"dart-sass": "^1.25.0",
"plugin-error": "^1.0.1",
"through2": "^3.0.1",
"vinyl-sourcemaps-apply": "^0.2.1"
}
"name": "gulp-dart-scss",
"version": "1.0.4",
"description": "Gulp plugin to compile Sass using the Dart Sass compiler.",
"author": "Kasper Hesthaven",
"repository": "kasperhesthaven/gulp-dart-scss",
"license": "MIT",
"main": "index.js",
"engines": {
"node": ">=7"
},
"keywords": [
"dartsass",
"gulpplugin",
"sass"
],
"dependencies": {
"sass": "^1.26.3",
"plugin-error": "^1.0.1",
"through2": "^3.0.1",
"vinyl-sourcemaps-apply": "^0.2.1"
}
}
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