@uniweb/build 0.6.9 → 0.6.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "0.6.9",
3
+ "version": "0.6.11",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -50,8 +50,8 @@
50
50
  "sharp": "^0.33.2"
51
51
  },
52
52
  "optionalDependencies": {
53
- "@uniweb/schemas": "0.2.1",
54
53
  "@uniweb/runtime": "0.5.17",
54
+ "@uniweb/schemas": "0.2.1",
55
55
  "@uniweb/content-reader": "1.1.2"
56
56
  },
57
57
  "peerDependencies": {
@@ -185,6 +185,11 @@ export async function defineSiteConfig(options = {}) {
185
185
  const isRuntimeMode =
186
186
  isShellMode || process.env.VITE_FOUNDATION_MODE === 'runtime' || foundationInfo.type === 'url'
187
187
 
188
+ // Extensions are always runtime-loaded via import(), so they need import maps
189
+ // to resolve bare specifiers (react, @uniweb/core) even in bundled mode
190
+ const hasExtensions = siteConfig.extensions?.length > 0
191
+ const needsImportMap = isRuntimeMode || hasExtensions
192
+
188
193
  // Dynamic imports for optional peer dependencies
189
194
  // These are imported dynamically to avoid requiring them when not needed
190
195
  const imports = [
@@ -333,7 +338,7 @@ export async function defineSiteConfig(options = {}) {
333
338
  ]
334
339
  const IMPORT_MAP_PREFIX = '\0importmap:'
335
340
 
336
- const importMapPlugin = isRuntimeMode ? (() => {
341
+ const importMapPlugin = needsImportMap ? (() => {
337
342
  let isBuild = false
338
343
 
339
344
  return {