@fluffjs/cli 0.1.5 → 0.1.7
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 +31 -12
- package/package.json +1 -1
package/Cli.js
CHANGED
|
@@ -309,13 +309,21 @@ 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
|
-
console.
|
|
312
|
+
for (const stylePath of target.styles) {
|
|
313
|
+
const fullPath = path.resolve(srcDir, stylePath);
|
|
314
|
+
if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
|
|
315
|
+
console.log(` ✓ Style: ${stylePath}`);
|
|
316
|
+
styleContents.push(fs.readFileSync(fullPath, 'utf-8'));
|
|
316
317
|
}
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
else {
|
|
319
|
+
const styleFiles = this.findFiles(srcDir, [stylePath]);
|
|
320
|
+
if (styleFiles.length === 0) {
|
|
321
|
+
console.warn(` ⚠ Style not found: ${fullPath}`);
|
|
322
|
+
}
|
|
323
|
+
for (const styleFile of styleFiles) {
|
|
324
|
+
console.log(` ✓ Style: ${path.relative(srcDir, styleFile)}`);
|
|
325
|
+
styleContents.push(fs.readFileSync(styleFile, 'utf-8'));
|
|
326
|
+
}
|
|
319
327
|
}
|
|
320
328
|
}
|
|
321
329
|
if (styleContents.length > 0) {
|
|
@@ -490,13 +498,21 @@ Examples:
|
|
|
490
498
|
let inlineStyles = '';
|
|
491
499
|
if (target.styles && target.styles.length > 0) {
|
|
492
500
|
const styleContents = [];
|
|
493
|
-
for (const
|
|
494
|
-
const
|
|
495
|
-
if (
|
|
496
|
-
console.
|
|
501
|
+
for (const stylePath of target.styles) {
|
|
502
|
+
const fullPath = path.resolve(srcDir, stylePath);
|
|
503
|
+
if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {
|
|
504
|
+
console.log(` ✓ Style: ${stylePath}`);
|
|
505
|
+
styleContents.push(fs.readFileSync(fullPath, 'utf-8'));
|
|
497
506
|
}
|
|
498
|
-
|
|
499
|
-
|
|
507
|
+
else {
|
|
508
|
+
const styleFiles = this.findFiles(srcDir, [stylePath]);
|
|
509
|
+
if (styleFiles.length === 0) {
|
|
510
|
+
console.warn(` ⚠ Style not found: ${fullPath}`);
|
|
511
|
+
}
|
|
512
|
+
for (const styleFile of styleFiles) {
|
|
513
|
+
console.log(` ✓ Style: ${path.relative(srcDir, styleFile)}`);
|
|
514
|
+
styleContents.push(fs.readFileSync(styleFile, 'utf-8'));
|
|
515
|
+
}
|
|
500
516
|
}
|
|
501
517
|
}
|
|
502
518
|
if (styleContents.length > 0) {
|
|
@@ -561,6 +577,9 @@ Examples:
|
|
|
561
577
|
}
|
|
562
578
|
generateEntryPoint(srcDir, componentPatterns) {
|
|
563
579
|
const componentFiles = this.findFiles(srcDir, componentPatterns);
|
|
580
|
+
for (const f of componentFiles) {
|
|
581
|
+
console.log(` ✓ Component: ${path.relative(srcDir, f)}`);
|
|
582
|
+
}
|
|
564
583
|
const importDecls = componentFiles.map(f => {
|
|
565
584
|
const relativePath = './' + path.relative(srcDir, f)
|
|
566
585
|
.replace(/\\/g, '/');
|