@webmate-studio/builder 0.2.124 → 0.2.125
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/src/bundler.js +9 -8
package/package.json
CHANGED
package/src/bundler.js
CHANGED
|
@@ -25,7 +25,8 @@ export async function bundleIsland(islandPath, outputPath, options = {}) {
|
|
|
25
25
|
sourcemap = true,
|
|
26
26
|
target = 'es2020',
|
|
27
27
|
format = 'esm',
|
|
28
|
-
componentDir = null //
|
|
28
|
+
componentDir = null, // Component directory for component-specific node_modules
|
|
29
|
+
svelteCustomElement = true // Set false for mount()-based islands (preview mode)
|
|
29
30
|
} = options;
|
|
30
31
|
|
|
31
32
|
try {
|
|
@@ -152,12 +153,12 @@ export async function bundleIsland(islandPath, outputPath, options = {}) {
|
|
|
152
153
|
});
|
|
153
154
|
}
|
|
154
155
|
},
|
|
155
|
-
// Svelte support
|
|
156
|
+
// Svelte support
|
|
156
157
|
esbuildSvelte({
|
|
157
158
|
compilerOptions: {
|
|
158
|
-
customElement:
|
|
159
|
-
css: 'injected',
|
|
160
|
-
runes: true
|
|
159
|
+
customElement: svelteCustomElement,
|
|
160
|
+
css: 'injected',
|
|
161
|
+
runes: true
|
|
161
162
|
}
|
|
162
163
|
})
|
|
163
164
|
],
|
|
@@ -191,7 +192,7 @@ export async function bundleIsland(islandPath, outputPath, options = {}) {
|
|
|
191
192
|
/**
|
|
192
193
|
* Bundle all islands in a component directory
|
|
193
194
|
*/
|
|
194
|
-
export async function bundleComponentIslands(componentDir, outputDir) {
|
|
195
|
+
export async function bundleComponentIslands(componentDir, outputDir, options = {}) {
|
|
195
196
|
const islandsDir = path.join(componentDir, 'islands');
|
|
196
197
|
|
|
197
198
|
// Check if islands directory exists
|
|
@@ -230,8 +231,8 @@ export async function bundleComponentIslands(componentDir, outputDir) {
|
|
|
230
231
|
|
|
231
232
|
console.log(pc.dim(` Bundling ${islandFile}...`));
|
|
232
233
|
|
|
233
|
-
// Pass componentDir
|
|
234
|
-
const result = await bundleIsland(inputPath, outputPath, { componentDir });
|
|
234
|
+
// Pass componentDir and any extra options to bundler
|
|
235
|
+
const result = await bundleIsland(inputPath, outputPath, { componentDir, ...options });
|
|
235
236
|
|
|
236
237
|
if (result.success) {
|
|
237
238
|
const sizeKb = (result.size / 1024).toFixed(2);
|