@webmate-studio/builder 0.2.27 → 0.2.29
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/build-service.js +20 -5
- package/package.json +1 -1
package/build-service.js
CHANGED
|
@@ -197,14 +197,17 @@ async function buildComponent(payload) {
|
|
|
197
197
|
// Read bundled content
|
|
198
198
|
const bundledContent = readFileSync(outputPath, 'utf8');
|
|
199
199
|
|
|
200
|
+
// Use output filename (.js) not input filename (.svelte)
|
|
201
|
+
const outputFilename = island.file.replace(/\.(jsx?|tsx?|svelte|vue)$/, '.js');
|
|
202
|
+
|
|
200
203
|
bundledIslands.push({
|
|
201
|
-
file:
|
|
204
|
+
file: outputFilename, // Use .js extension!
|
|
202
205
|
content: bundledContent,
|
|
203
206
|
size: result.size,
|
|
204
207
|
originalSize: island.content.length
|
|
205
208
|
});
|
|
206
209
|
|
|
207
|
-
console.log(`[Build Service] ✓ ${island.file} → ${(result.size / 1024).toFixed(2)}kb`);
|
|
210
|
+
console.log(`[Build Service] ✓ ${island.file} → ${outputFilename} (${(result.size / 1024).toFixed(2)}kb)`);
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
|
|
@@ -216,11 +219,23 @@ async function buildComponent(payload) {
|
|
|
216
219
|
console.log(`[Build Service] ✓ Transformed HTML: ${islandNames.length} island(s) → Custom Elements`);
|
|
217
220
|
}
|
|
218
221
|
|
|
219
|
-
// Generate CSS
|
|
222
|
+
// Generate CSS from HTML + Islands
|
|
220
223
|
let css = '';
|
|
221
|
-
if (transformedHtml) {
|
|
224
|
+
if (transformedHtml || bundledIslands.length > 0) {
|
|
222
225
|
console.log('[Build Service] Generating CSS...');
|
|
223
|
-
|
|
226
|
+
|
|
227
|
+
// Combine HTML and island content for CSS scanning
|
|
228
|
+
let contentToScan = transformedHtml || '';
|
|
229
|
+
|
|
230
|
+
// Add island content (they contain Tailwind classes too!)
|
|
231
|
+
if (bundledIslands.length > 0) {
|
|
232
|
+
for (const island of bundledIslands) {
|
|
233
|
+
contentToScan += '\n' + island.content;
|
|
234
|
+
}
|
|
235
|
+
console.log(`[Build Service] Including ${bundledIslands.length} island(s) for CSS scanning`);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const cssResult = await generateComponentCSS(contentToScan, {
|
|
224
239
|
designTokens: null,
|
|
225
240
|
minify: true
|
|
226
241
|
});
|