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

@18f/identity-build-sass

Package Overview
Dependencies
Maintainers
6
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@18f/identity-build-sass - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

get-error-sass-stack-paths.js

11

cli.js

@@ -8,2 +8,3 @@ #!/usr/bin/env node

import { buildFile } from './index.js';
import getErrorSassStackPaths from './get-error-sass-stack-paths.js';

@@ -23,5 +24,8 @@ /** @typedef {import('sass-embedded').Options<'sync'>} SyncSassOptions */

const outDir = flags.find((flag) => flag.startsWith('--out-dir='))?.slice(10);
const loadPaths = flags
.filter((flag) => flag.startsWith('--load-path='))
.map((flag) => flag.slice(12));
/** @type {BuildOptions & SyncSassOptions} */
const options = { outDir, optimize: isProduction };
const options = { outDir, loadPaths, optimize: isProduction };

@@ -67,5 +71,4 @@ /**

if (isWatching && isSassException(error) && error.span.url) {
const exceptionPath = fileURLToPath(error.span.url);
watchOnce(exceptionPath, () => build(files));
if (isWatching && isSassException(error)) {
watchOnce(getErrorSassStackPaths(error.sassStack), () => build(files));
} else {

@@ -72,0 +75,0 @@ throw error;

@@ -30,7 +30,7 @@ import { basename, join } from 'path';

export async function buildFile(file, options) {
const { outDir, optimize, ...sassOptions } = options;
const { outDir, optimize, loadPaths = [], ...sassOptions } = options;
const sassResult = sass.compile(file, {
style: optimize ? 'compressed' : 'expanded',
...sassOptions,
loadPaths: ['node_modules'],
loadPaths: ['node_modules', ...loadPaths],
quietDeps: true,

@@ -37,0 +37,0 @@ });

{
"name": "@18f/identity-build-sass",
"version": "1.0.0",
"version": "1.1.0",
"private": false,

@@ -17,3 +17,4 @@ "description": "Stylesheet compilation utility with reasonable defaults and fast performance.",

"index.js",
"cli.js"
"cli.js",
"get-error-sass-stack-paths.js"
],

@@ -26,3 +27,3 @@ "license": "CC0-1.0",

"dependencies": {
"browserslist": "^4.21.4",
"browserslist": "^4.21.5",
"chokidar": "^3.5.3",

@@ -29,0 +30,0 @@ "lightningcss": "^1.16.1",

@@ -25,3 +25,3 @@ # `@18f/identity-build-sass`

```
npx build-sass path/to/sass/*.css.scss --out-dir=build
npx build-sass path/to/sass/*.css.scss --out-dir=build --load-path=node_modules/@uswds/uswds/packages
```

@@ -33,2 +33,3 @@

- `--watch`: Run in watch mode, recompiling files on change
- `--load-path`: Include additional path in Sass path resolution

@@ -35,0 +36,0 @@ ### API

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