@18f/identity-build-sass
Advanced tools
Comparing version 1.3.0 to 2.0.0
@@ -31,3 +31,3 @@ #!/usr/bin/env node | ||
const outDir = flags['out-dir']; | ||
const loadPaths = [...getDefaultLoadPaths(), ...flags['load-path']]; | ||
const loadPaths = [...flags['load-path'], ...getDefaultLoadPaths()]; | ||
@@ -34,0 +34,0 @@ /** @type {BuildOptions & SyncSassOptions} */ |
14
index.js
@@ -1,4 +0,6 @@ | ||
import { basename, join } from 'path'; | ||
import { writeFile } from 'fs/promises'; | ||
import sass from 'sass-embedded'; | ||
import { basename, join } from 'node:path'; | ||
import { createWriteStream } from 'node:fs'; | ||
import { Readable } from 'node:stream'; | ||
import { pipeline } from 'node:stream/promises'; | ||
import { compile as sassCompile } from 'sass-embedded'; | ||
import { transform as lightningTransform, browserslistToTargets } from 'lightningcss'; | ||
@@ -31,6 +33,6 @@ import browserslist from 'browserslist'; | ||
const { outDir, optimize, loadPaths = [], ...sassOptions } = options; | ||
const sassResult = sass.compile(file, { | ||
const sassResult = sassCompile(file, { | ||
style: optimize ? 'compressed' : 'expanded', | ||
...sassOptions, | ||
loadPaths: ['node_modules', ...loadPaths], | ||
loadPaths: [...loadPaths, 'node_modules'], | ||
quietDeps: true, | ||
@@ -52,5 +54,5 @@ }); | ||
await writeFile(outFile, lightningResult.code); | ||
await pipeline(Readable.from(lightningResult.code), createWriteStream(outFile)); | ||
return sassResult; | ||
} |
{ | ||
"name": "@18f/identity-build-sass", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"private": false, | ||
@@ -29,7 +29,7 @@ "description": "Stylesheet compilation utility with reasonable defaults and fast performance.", | ||
"@pkgjs/parseargs": "^0.11.0", | ||
"browserslist": "^4.21.5", | ||
"browserslist": "^4.22.1", | ||
"chokidar": "^3.5.3", | ||
"lightningcss": "^1.16.1", | ||
"sass-embedded": "^1.56.1" | ||
"lightningcss": "^1.22.0", | ||
"sass-embedded": "^1.69.2" | ||
} | ||
} |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
10646
171
2
Updatedbrowserslist@^4.22.1
Updatedlightningcss@^1.22.0
Updatedsass-embedded@^1.69.2