@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/bundler.js +9 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.124",
3
+ "version": "0.2.125",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
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 // NEW: Component directory for component-specific node_modules
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 (Svelte 5 Web Components)
156
+ // Svelte support
156
157
  esbuildSvelte({
157
158
  compilerOptions: {
158
- customElement: true, // Compile to Web Components
159
- css: 'injected', // CSS always injected for custom elements
160
- runes: true // Enable Svelte 5 runes ($props, $derived, $effect, etc.)
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 to bundler for component-specific node_modules resolution
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);