@vojtaholik/static-kit-core 1.0.6 → 1.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-plugins.d.ts","sourceRoot":"","sources":["../../src/plugins/build-plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AASnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"build-plugins.d.ts","sourceRoot":"","sources":["../../src/plugins/build-plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AASnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,EAAE,CAySnE"}
|
|
@@ -87,6 +87,44 @@ export function buildPlugins(options) {
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
|
+
// Copy images directory
|
|
91
|
+
{
|
|
92
|
+
name: "copy-images-directory",
|
|
93
|
+
apply: "build",
|
|
94
|
+
writeBundle: async () => {
|
|
95
|
+
try {
|
|
96
|
+
const srcImagesPath = path.resolve("src/images");
|
|
97
|
+
const destImagesPath = path.resolve(`dist/${normalizedBase}images`);
|
|
98
|
+
// Check if images directory exists
|
|
99
|
+
try {
|
|
100
|
+
await fs.access(srcImagesPath);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
// Images directory doesn't exist, skip silently
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
// Create dist/images directory
|
|
107
|
+
await fs.mkdir(destImagesPath, { recursive: true });
|
|
108
|
+
// Copy all files from src/images to dist/public/images using fast-glob
|
|
109
|
+
const imageFiles = await fg("**/*", {
|
|
110
|
+
cwd: srcImagesPath,
|
|
111
|
+
onlyFiles: true,
|
|
112
|
+
dot: true,
|
|
113
|
+
});
|
|
114
|
+
for (const file of imageFiles) {
|
|
115
|
+
const srcPath = path.join(srcImagesPath, file);
|
|
116
|
+
const destPath = path.join(destImagesPath, file);
|
|
117
|
+
// Ensure destination directory exists
|
|
118
|
+
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
119
|
+
await fs.copyFile(srcPath, destPath);
|
|
120
|
+
}
|
|
121
|
+
console.log(`🖼️ Copied ${imageFiles.length} image files to dist/images`);
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
console.warn("Could not copy images directory:", error);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
},
|
|
90
128
|
// Copy and compile JS/TS files without bundling
|
|
91
129
|
{
|
|
92
130
|
name: "copy-compile-js-files",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-config.d.ts","sourceRoot":"","sources":["../src/vite-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,mBAAmB,EAAU,MAAM,MAAM,CAAC;AAQpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,gBAAqB,GAC7B,mBAAmB,
|
|
1
|
+
{"version":3,"file":"vite-config.d.ts","sourceRoot":"","sources":["../src/vite-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,mBAAmB,EAAU,MAAM,MAAM,CAAC;AAQpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,gBAAqB,GAC7B,mBAAmB,CA2GrB;AAGD,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,uBAE7D"}
|
package/dist/vite-config.js
CHANGED
|
@@ -69,6 +69,10 @@ export function createStaticKitConfig(options = {}) {
|
|
|
69
69
|
if (assetInfo.name?.match(/\.(woff2?|ttf|otf|eot)$/i)) {
|
|
70
70
|
return `${normalizedBase}fonts/[name][extname]`;
|
|
71
71
|
}
|
|
72
|
+
// Handle image files - put them in images/ directory without hash
|
|
73
|
+
if (assetInfo.name?.match(/\.(png|jpe?g|gif|webp|avif|svg)$/i)) {
|
|
74
|
+
return `${normalizedBase}images/[name][extname]`;
|
|
75
|
+
}
|
|
72
76
|
return `${normalizedBase}assets/[name]-[hash][extname]`;
|
|
73
77
|
},
|
|
74
78
|
},
|