@stencil/sass
Advanced tools
Comparing version 1.3.2 to 1.4.0-0
@@ -34,3 +34,3 @@ export * from '@stencil/core/internal'; | ||
*/ | ||
injectGlobalPaths?: string[]; | ||
injectGlobalPaths?: ([string, string] | string)[]; | ||
/** | ||
@@ -37,0 +37,0 @@ * Enable Sass Indented Syntax for parsing the data string or file. |
@@ -26,16 +26,18 @@ import * as path from 'path'; | ||
// automatically inject each of these paths into the source text | ||
const injectText = injectGlobalPaths.map(injectGlobalPath => { | ||
if (!path.isAbsolute(injectGlobalPath)) { | ||
const injectText = injectGlobalPaths.map((injectGlobalPath) => { | ||
const includesNamespace = Array.isArray(injectGlobalPath); | ||
let importPath = includesNamespace ? injectGlobalPath[0] : injectGlobalPath; | ||
if (!path.isAbsolute(importPath)) { | ||
// convert any relative paths to absolute paths relative to the project root | ||
if (context.sys && typeof context.sys.normalizePath === 'function') { | ||
// context.sys.normalizePath added in stencil 1.11.0 | ||
injectGlobalPath = context.sys.normalizePath(path.join(context.config.rootDir, injectGlobalPath)); | ||
importPath = context.sys.normalizePath(path.join(context.config.rootDir, importPath)); | ||
} | ||
else { | ||
// TODO, eventually remove normalizePath() from @stencil/sass | ||
injectGlobalPath = normalizePath(path.join(context.config.rootDir, injectGlobalPath)); | ||
importPath = normalizePath(path.join(context.config.rootDir, importPath)); | ||
} | ||
} | ||
const importTerminator = renderOpts.indentedSyntax ? '\n' : ';'; | ||
return `@import "${injectGlobalPath}"${importTerminator}`; | ||
return `@use "${importPath}"${includesNamespace ? ` as ${injectGlobalPath[1]}` : ''}${importTerminator}`; | ||
}).join(''); | ||
@@ -42,0 +44,0 @@ renderOpts.data = injectText + renderOpts.data; |
{ | ||
"name": "@stencil/sass", | ||
"version": "1.3.2", | ||
"version": "1.4.0-0", | ||
"license": "MIT", | ||
@@ -54,2 +54,2 @@ "main": "dist/index.js", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4554476
18393
1