@fluffjs/cli 0.1.4 → 0.1.6
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/Cli.js +26 -8
- package/package.json +1 -1
package/Cli.js
CHANGED
|
@@ -309,10 +309,19 @@ Examples:
|
|
|
309
309
|
let inlineStyles = '';
|
|
310
310
|
if (target.styles && target.styles.length > 0) {
|
|
311
311
|
const styleContents = [];
|
|
312
|
-
for (const
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
styleContents.push(fs.readFileSync(
|
|
312
|
+
for (const stylePath of target.styles) {
|
|
313
|
+
const fullPath = path.resolve(srcDir, stylePath);
|
|
314
|
+
if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
|
|
315
|
+
styleContents.push(fs.readFileSync(fullPath, 'utf-8'));
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
const styleFiles = this.findFiles(srcDir, [stylePath]);
|
|
319
|
+
if (styleFiles.length === 0) {
|
|
320
|
+
console.warn(` ⚠ Style not found: ${fullPath}`);
|
|
321
|
+
}
|
|
322
|
+
for (const styleFile of styleFiles) {
|
|
323
|
+
styleContents.push(fs.readFileSync(styleFile, 'utf-8'));
|
|
324
|
+
}
|
|
316
325
|
}
|
|
317
326
|
}
|
|
318
327
|
if (styleContents.length > 0) {
|
|
@@ -487,10 +496,19 @@ Examples:
|
|
|
487
496
|
let inlineStyles = '';
|
|
488
497
|
if (target.styles && target.styles.length > 0) {
|
|
489
498
|
const styleContents = [];
|
|
490
|
-
for (const
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
styleContents.push(fs.readFileSync(
|
|
499
|
+
for (const stylePath of target.styles) {
|
|
500
|
+
const fullPath = path.resolve(srcDir, stylePath);
|
|
501
|
+
if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
|
|
502
|
+
styleContents.push(fs.readFileSync(fullPath, 'utf-8'));
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
const styleFiles = this.findFiles(srcDir, [stylePath]);
|
|
506
|
+
if (styleFiles.length === 0) {
|
|
507
|
+
console.warn(` ⚠ Style not found: ${fullPath}`);
|
|
508
|
+
}
|
|
509
|
+
for (const styleFile of styleFiles) {
|
|
510
|
+
styleContents.push(fs.readFileSync(styleFile, 'utf-8'));
|
|
511
|
+
}
|
|
494
512
|
}
|
|
495
513
|
}
|
|
496
514
|
if (styleContents.length > 0) {
|