@stylable/build-tools
Advanced tools
Comparing version 4.2.1 to 4.2.2
import { StylableMeta } from '@stylable/core'; | ||
export declare function processUrlDependencies(meta: StylableMeta, rootContext: string): string[]; | ||
export declare function processUrlDependencies(meta: StylableMeta, rootContext: string, filter?: (url: string, context: string) => boolean): string[]; | ||
//# sourceMappingURL=process-url-dependencies.d.ts.map |
@@ -6,3 +6,6 @@ "use strict"; | ||
const path_1 = require("path"); | ||
function processUrlDependencies(meta, rootContext) { | ||
function defaultFilter() { | ||
return true; | ||
} | ||
function processUrlDependencies(meta, rootContext, filter = defaultFilter) { | ||
const importerDir = path_1.dirname(meta.source); | ||
@@ -12,3 +15,3 @@ const urls = []; | ||
const { url } = node; | ||
if (url && core_1.isAsset(url)) { | ||
if (url && core_1.isAsset(url) && filter(url, importerDir)) { | ||
node.stringType = '"'; | ||
@@ -15,0 +18,0 @@ delete node.innerSpacingBefore; |
{ | ||
"name": "@stylable/build-tools", | ||
"version": "4.2.1", | ||
"version": "4.2.2", | ||
"description": "Collection of helper functions for Stylable based tooling.", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@stylable/core": "^4.2.1", | ||
"@stylable/core": "^4.2.2", | ||
"find-config": "^1.0.0" | ||
@@ -13,0 +13,0 @@ }, |
@@ -5,3 +5,11 @@ import type { UrlNode } from 'css-selector-tokenizer'; | ||
export function processUrlDependencies(meta: StylableMeta, rootContext: string) { | ||
function defaultFilter() { | ||
return true; | ||
} | ||
export function processUrlDependencies( | ||
meta: StylableMeta, | ||
rootContext: string, | ||
filter: (url: string, context: string) => boolean = defaultFilter | ||
) { | ||
const importerDir = dirname(meta.source); | ||
@@ -11,3 +19,3 @@ const urls: string[] = []; | ||
const { url } = node; | ||
if (url && isAsset(url)) { | ||
if (url && isAsset(url) && filter(url, importerDir)) { | ||
node.stringType = '"'; | ||
@@ -14,0 +22,0 @@ delete node.innerSpacingBefore; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
23259
347
Updated@stylable/core@^4.2.2