@fluffjs/cli 0.1.5 → 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 +24 -12
- package/package.json +1 -1
package/Cli.js
CHANGED
|
@@ -309,13 +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
|
-
if (
|
|
315
|
-
|
|
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
316
|
}
|
|
317
|
-
|
|
318
|
-
|
|
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
|
+
}
|
|
319
325
|
}
|
|
320
326
|
}
|
|
321
327
|
if (styleContents.length > 0) {
|
|
@@ -490,13 +496,19 @@ Examples:
|
|
|
490
496
|
let inlineStyles = '';
|
|
491
497
|
if (target.styles && target.styles.length > 0) {
|
|
492
498
|
const styleContents = [];
|
|
493
|
-
for (const
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
|
|
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'));
|
|
497
503
|
}
|
|
498
|
-
|
|
499
|
-
|
|
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
|
+
}
|
|
500
512
|
}
|
|
501
513
|
}
|
|
502
514
|
if (styleContents.length > 0) {
|