aztomiq 1.0.6 → 1.0.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/package.json +1 -1
- package/scripts/builds/assets.js +21 -10
- package/scripts/builds/pages.js +1 -0
package/package.json
CHANGED
package/scripts/builds/assets.js
CHANGED
|
@@ -67,16 +67,27 @@ async function buildAssets() {
|
|
|
67
67
|
console.time('🎨 Assets Build');
|
|
68
68
|
|
|
69
69
|
// 0. Copy all raw assets (images, fonts, vendor, etc)
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
const assetSubDirs = ['images', 'fonts', 'vendor', 'favicons'];
|
|
71
|
+
for (const sub of assetSubDirs) {
|
|
72
|
+
const srcDirs = [
|
|
73
|
+
path.join(paths.CORE_ROOT, 'src/assets', sub),
|
|
74
|
+
path.join(paths.SRC, 'assets', sub)
|
|
75
|
+
].filter(fs.existsSync);
|
|
76
|
+
|
|
77
|
+
if (srcDirs.length === 0) continue;
|
|
78
|
+
|
|
79
|
+
const destDir = path.join(paths.ASSETS_DIST, sub);
|
|
80
|
+
await fs.ensureDir(destDir);
|
|
81
|
+
|
|
82
|
+
for (const dir of srcDirs) {
|
|
83
|
+
const items = fs.readdirSync(dir);
|
|
84
|
+
for (const item of items) {
|
|
85
|
+
const srcPath = path.join(dir, item);
|
|
86
|
+
const destPath = path.join(destDir, item);
|
|
87
|
+
if (hasChanged(srcPath, `assets-${sub}/`, false)) {
|
|
88
|
+
await fs.copy(srcPath, destPath);
|
|
89
|
+
hasChanged(srcPath, `assets-${sub}/`, true);
|
|
90
|
+
}
|
|
80
91
|
}
|
|
81
92
|
}
|
|
82
93
|
}
|