leanweb 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/build.js +2 -2
- package/commands/utils.js +3 -3
- package/package.json +1 -1
package/commands/build.js
CHANGED
|
@@ -81,10 +81,10 @@ const require = createRequire(import.meta.url);
|
|
|
81
81
|
const scssFileExists = fs.existsSync(scssFilename);
|
|
82
82
|
let cssString = '';
|
|
83
83
|
if (scssFileExists) {
|
|
84
|
-
let scssString = `@use "
|
|
84
|
+
let scssString = `@use "global-styles.scss";\n`;
|
|
85
85
|
scssString += fs.readFileSync(scssFilename, 'utf8');
|
|
86
86
|
scssString += '\n[lw-false],[lw-for]{display:none !important;}\n';
|
|
87
|
-
cssString = utils.buildCSS(scssString, `${buildDir}/components/${cmp}`);
|
|
87
|
+
cssString = utils.buildCSS(scssString, buildDir, `${buildDir}/components/${cmp}`);
|
|
88
88
|
}
|
|
89
89
|
const styleString = cssString || '';
|
|
90
90
|
const htmlString = fs.readFileSync(htmlFilename, 'utf8');
|
package/commands/utils.js
CHANGED
|
@@ -28,10 +28,10 @@ export const copySymbolLinkFilter = (src, dest) => {
|
|
|
28
28
|
|
|
29
29
|
export const exec = command => execSync(command, { encoding: 'utf8', stdio: 'inherit' });
|
|
30
30
|
|
|
31
|
-
export const buildCSS = (scssString, currentPaths) => {
|
|
31
|
+
export const buildCSS = (scssString, ...currentPaths) => {
|
|
32
32
|
if (scssString.trim()) {
|
|
33
|
-
const
|
|
34
|
-
const cssResult = sass.
|
|
33
|
+
const loadPaths = [...currentPaths, path.resolve(process.cwd(), dirs.build), path.resolve(process.cwd(), 'node_modules')];
|
|
34
|
+
const cssResult = sass.compileString(scssString, { loadPaths });
|
|
35
35
|
return cssResult.css.toString().trim();
|
|
36
36
|
}
|
|
37
37
|
return '';
|