@nativescript/vite 8.0.0-alpha.6 → 8.0.0-alpha.61

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 (465) hide show
  1. package/README.md +51 -11
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +34 -1
  4. package/configuration/angular.js +390 -165
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +244 -53
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +14 -93
  9. package/configuration/javascript.js.map +1 -1
  10. package/configuration/react.js +41 -73
  11. package/configuration/react.js.map +1 -1
  12. package/configuration/solid.js +51 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +12 -93
  15. package/configuration/typescript.js.map +1 -1
  16. package/helpers/app-components.d.ts +2 -1
  17. package/helpers/app-components.js.map +1 -1
  18. package/helpers/app-css-state.d.ts +8 -0
  19. package/helpers/app-css-state.js +8 -0
  20. package/helpers/app-css-state.js.map +1 -0
  21. package/helpers/bundler-context.d.ts +11 -0
  22. package/helpers/bundler-context.js +71 -0
  23. package/helpers/bundler-context.js.map +1 -0
  24. package/helpers/cli-flags.d.ts +12 -0
  25. package/helpers/cli-flags.js +34 -0
  26. package/helpers/cli-flags.js.map +1 -1
  27. package/helpers/css-platform-plugin.d.ts +14 -0
  28. package/helpers/css-platform-plugin.js +43 -25
  29. package/helpers/css-platform-plugin.js.map +1 -1
  30. package/helpers/dev-host.d.ts +360 -0
  31. package/helpers/dev-host.js +694 -0
  32. package/helpers/dev-host.js.map +1 -0
  33. package/helpers/dynamic-import-plugin.js +9 -4
  34. package/helpers/dynamic-import-plugin.js.map +1 -1
  35. package/helpers/esbuild-platform-resolver.js +4 -1
  36. package/helpers/esbuild-platform-resolver.js.map +1 -1
  37. package/helpers/external-configs.d.ts +10 -12
  38. package/helpers/external-configs.js +58 -35
  39. package/helpers/external-configs.js.map +1 -1
  40. package/helpers/global-defines.d.ts +100 -13
  41. package/helpers/global-defines.js +165 -28
  42. package/helpers/global-defines.js.map +1 -1
  43. package/helpers/hmr-scope.d.ts +26 -0
  44. package/helpers/hmr-scope.js +67 -0
  45. package/helpers/hmr-scope.js.map +1 -0
  46. package/helpers/init.js +0 -18
  47. package/helpers/init.js.map +1 -1
  48. package/helpers/logging.js +29 -1
  49. package/helpers/logging.js.map +1 -1
  50. package/helpers/main-entry.d.ts +4 -1
  51. package/helpers/main-entry.js +368 -53
  52. package/helpers/main-entry.js.map +1 -1
  53. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  54. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  55. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  56. package/helpers/nativeclass-transform.d.ts +13 -0
  57. package/helpers/nativeclass-transform.js +37 -7
  58. package/helpers/nativeclass-transform.js.map +1 -1
  59. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  60. package/helpers/nativeclass-transformer-plugin.js +163 -15
  61. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  62. package/helpers/nativescript-package-resolver.js +10 -62
  63. package/helpers/nativescript-package-resolver.js.map +1 -1
  64. package/helpers/normalize-id.d.ts +42 -0
  65. package/helpers/normalize-id.js +60 -0
  66. package/helpers/normalize-id.js.map +1 -0
  67. package/helpers/ns-core-url.d.ts +29 -7
  68. package/helpers/ns-core-url.js +69 -12
  69. package/helpers/ns-core-url.js.map +1 -1
  70. package/helpers/optimize-deps.d.ts +16 -0
  71. package/helpers/optimize-deps.js +17 -0
  72. package/helpers/optimize-deps.js.map +1 -0
  73. package/helpers/package-platform-aliases.js +34 -49
  74. package/helpers/package-platform-aliases.js.map +1 -1
  75. package/helpers/platform-types.d.ts +2 -0
  76. package/helpers/platform-types.js +2 -0
  77. package/helpers/platform-types.js.map +1 -0
  78. package/helpers/postcss-platform-config.d.ts +17 -1
  79. package/helpers/postcss-platform-config.js +20 -37
  80. package/helpers/postcss-platform-config.js.map +1 -1
  81. package/helpers/project.d.ts +35 -0
  82. package/helpers/project.js +120 -2
  83. package/helpers/project.js.map +1 -1
  84. package/helpers/resolve-main-field-platform.d.ts +20 -0
  85. package/helpers/resolve-main-field-platform.js +49 -0
  86. package/helpers/resolve-main-field-platform.js.map +1 -0
  87. package/helpers/resolver.js +17 -2
  88. package/helpers/resolver.js.map +1 -1
  89. package/helpers/theme-core-plugins.js +1 -1
  90. package/helpers/theme-core-plugins.js.map +1 -1
  91. package/helpers/ts-config-paths.d.ts +32 -0
  92. package/helpers/ts-config-paths.js +156 -27
  93. package/helpers/ts-config-paths.js.map +1 -1
  94. package/helpers/typescript-check.d.ts +2 -1
  95. package/helpers/typescript-check.js +2 -2
  96. package/helpers/typescript-check.js.map +1 -1
  97. package/helpers/ui-registration.d.ts +21 -0
  98. package/helpers/ui-registration.js +156 -0
  99. package/helpers/ui-registration.js.map +1 -0
  100. package/helpers/utils.d.ts +9 -0
  101. package/helpers/utils.js +22 -2
  102. package/helpers/utils.js.map +1 -1
  103. package/helpers/vite-package-version.d.ts +7 -0
  104. package/helpers/vite-package-version.js +44 -0
  105. package/helpers/vite-package-version.js.map +1 -0
  106. package/helpers/workers.d.ts +48 -19
  107. package/helpers/workers.js +662 -13
  108. package/helpers/workers.js.map +1 -1
  109. package/hmr/client/css-handler.d.ts +2 -1
  110. package/hmr/client/css-handler.js +50 -26
  111. package/hmr/client/css-handler.js.map +1 -1
  112. package/hmr/client/css-update-overlay.d.ts +18 -0
  113. package/hmr/client/css-update-overlay.js +27 -0
  114. package/hmr/client/css-update-overlay.js.map +1 -0
  115. package/hmr/client/framework-client-strategy.d.ts +79 -0
  116. package/hmr/client/framework-client-strategy.js +19 -0
  117. package/hmr/client/framework-client-strategy.js.map +1 -0
  118. package/hmr/client/hmr-pending-overlay.d.ts +0 -14
  119. package/hmr/client/hmr-pending-overlay.js +14 -4
  120. package/hmr/client/hmr-pending-overlay.js.map +1 -1
  121. package/hmr/client/hot-context.d.ts +67 -0
  122. package/hmr/client/hot-context.js +284 -0
  123. package/hmr/client/hot-context.js.map +1 -0
  124. package/hmr/client/index.js +922 -273
  125. package/hmr/client/index.js.map +1 -1
  126. package/hmr/client/utils.d.ts +2 -1
  127. package/hmr/client/utils.js +111 -99
  128. package/hmr/client/utils.js.map +1 -1
  129. package/hmr/entry-runtime.d.ts +2 -1
  130. package/hmr/entry-runtime.js +279 -71
  131. package/hmr/entry-runtime.js.map +1 -1
  132. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  133. package/hmr/frameworks/angular/build/angular-linker.js +109 -0
  134. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  135. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  136. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  137. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  138. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  139. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  140. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  141. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  142. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  143. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  144. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  145. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  146. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  147. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  148. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  149. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  150. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  151. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  152. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  153. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  154. package/hmr/frameworks/angular/build/util.js +155 -0
  155. package/hmr/frameworks/angular/build/util.js.map +1 -0
  156. package/hmr/frameworks/angular/client/index.js +542 -175
  157. package/hmr/frameworks/angular/client/index.js.map +1 -1
  158. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  159. package/hmr/frameworks/angular/client/strategy.js +19 -0
  160. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  161. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  162. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  163. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  164. package/hmr/frameworks/angular/server/linker.js +1 -4
  165. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  166. package/hmr/frameworks/angular/server/strategy.js +458 -12
  167. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  168. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  169. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  170. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +14 -11
  171. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +108 -111
  172. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  173. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  174. package/hmr/frameworks/react/server/strategy.js +230 -0
  175. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  176. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  177. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  178. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  179. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  180. package/hmr/frameworks/solid/client/app-runtime.js +246 -0
  181. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  182. package/hmr/frameworks/solid/server/strategy.js +291 -16
  183. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  184. package/hmr/frameworks/typescript/server/strategy.js +38 -14
  185. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  186. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  187. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  188. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  189. package/hmr/frameworks/vue/client/index.d.ts +9 -0
  190. package/hmr/frameworks/vue/client/index.js +251 -247
  191. package/hmr/frameworks/vue/client/index.js.map +1 -1
  192. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  193. package/hmr/frameworks/vue/client/strategy.js +157 -0
  194. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  195. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  196. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +142 -0
  197. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  198. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  199. package/hmr/frameworks/vue/server/compiler.js +3 -1
  200. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  201. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  202. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  203. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  204. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  205. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  206. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  207. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  208. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  209. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  210. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  211. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  212. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  213. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  214. package/hmr/frameworks/vue/server/strategy.js +286 -7
  215. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  216. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  217. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  218. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  219. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  220. package/hmr/helpers/ast-normalizer.js +77 -10
  221. package/hmr/helpers/ast-normalizer.js.map +1 -1
  222. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  223. package/hmr/helpers/cjs-named-exports.js +152 -0
  224. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  225. package/hmr/helpers/package-exports.d.ts +16 -0
  226. package/hmr/helpers/package-exports.js +396 -0
  227. package/hmr/helpers/package-exports.js.map +1 -0
  228. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  229. package/hmr/helpers/vendor-rewrite.js +5 -3
  230. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  231. package/hmr/server/boot-archive-route.d.ts +40 -0
  232. package/hmr/server/boot-archive-route.js +154 -0
  233. package/hmr/server/boot-archive-route.js.map +1 -0
  234. package/hmr/server/boot-closure-route.d.ts +49 -0
  235. package/hmr/server/boot-closure-route.js +144 -0
  236. package/hmr/server/boot-closure-route.js.map +1 -0
  237. package/hmr/server/boot-recording.d.ts +58 -0
  238. package/hmr/server/boot-recording.js +228 -0
  239. package/hmr/server/boot-recording.js.map +1 -0
  240. package/hmr/server/constants.js +20 -5
  241. package/hmr/server/constants.js.map +1 -1
  242. package/hmr/server/core-bundle.d.ts +140 -0
  243. package/hmr/server/core-bundle.js +614 -0
  244. package/hmr/server/core-bundle.js.map +1 -0
  245. package/hmr/server/core-sanitize.d.ts +86 -7
  246. package/hmr/server/core-sanitize.js +170 -45
  247. package/hmr/server/core-sanitize.js.map +1 -1
  248. package/hmr/server/css-device-module.d.ts +28 -0
  249. package/hmr/server/css-device-module.js +44 -0
  250. package/hmr/server/css-device-module.js.map +1 -0
  251. package/hmr/server/deps-bundle.d.ts +218 -0
  252. package/hmr/server/deps-bundle.js +998 -0
  253. package/hmr/server/deps-bundle.js.map +1 -0
  254. package/hmr/server/device-transform-helpers.d.ts +24 -0
  255. package/hmr/server/device-transform-helpers.js +408 -0
  256. package/hmr/server/device-transform-helpers.js.map +1 -0
  257. package/hmr/server/framework-strategy.d.ts +113 -11
  258. package/hmr/server/hmr-module-graph.d.ts +37 -0
  259. package/hmr/server/hmr-module-graph.js +215 -0
  260. package/hmr/server/hmr-module-graph.js.map +1 -0
  261. package/hmr/server/import-map.d.ts +13 -4
  262. package/hmr/server/import-map.js +94 -47
  263. package/hmr/server/import-map.js.map +1 -1
  264. package/hmr/server/index.js +7 -16
  265. package/hmr/server/index.js.map +1 -1
  266. package/hmr/server/ns-core-cjs-shape.d.ts +2 -4
  267. package/hmr/server/ns-core-cjs-shape.js +4 -6
  268. package/hmr/server/ns-core-cjs-shape.js.map +1 -1
  269. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  270. package/hmr/server/ns-m-response-memo.js +33 -0
  271. package/hmr/server/ns-m-response-memo.js.map +1 -0
  272. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  273. package/hmr/server/ns-rt-bridge.js +131 -0
  274. package/hmr/server/ns-rt-bridge.js.map +1 -0
  275. package/hmr/server/ns-rt-route.d.ts +5 -0
  276. package/hmr/server/ns-rt-route.js +39 -0
  277. package/hmr/server/ns-rt-route.js.map +1 -0
  278. package/hmr/server/perf-instrumentation.d.ts +6 -10
  279. package/hmr/server/perf-instrumentation.js +5 -6
  280. package/hmr/server/perf-instrumentation.js.map +1 -1
  281. package/hmr/server/process-code-for-device.d.ts +30 -0
  282. package/hmr/server/process-code-for-device.js +791 -0
  283. package/hmr/server/process-code-for-device.js.map +1 -0
  284. package/hmr/server/require-guard.d.ts +1 -0
  285. package/hmr/server/require-guard.js +12 -0
  286. package/hmr/server/require-guard.js.map +1 -0
  287. package/hmr/server/rewrite-imports.d.ts +2 -0
  288. package/hmr/server/rewrite-imports.js +638 -0
  289. package/hmr/server/rewrite-imports.js.map +1 -0
  290. package/hmr/server/route-helpers.d.ts +7 -0
  291. package/hmr/server/route-helpers.js +13 -0
  292. package/hmr/server/route-helpers.js.map +1 -0
  293. package/hmr/server/server-origin.d.ts +2 -0
  294. package/hmr/server/server-origin.js +83 -0
  295. package/hmr/server/server-origin.js.map +1 -0
  296. package/hmr/server/shared-transform-request.js +1 -2
  297. package/hmr/server/shared-transform-request.js.map +1 -1
  298. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  299. package/hmr/server/transform-cache-invalidation.js +156 -0
  300. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  301. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  302. package/hmr/server/vendor-bare-module-shims.js +80 -0
  303. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  304. package/hmr/server/vite-plugin.d.ts +1 -0
  305. package/hmr/server/vite-plugin.js +180 -54
  306. package/hmr/server/vite-plugin.js.map +1 -1
  307. package/hmr/server/websocket-core-bridge.d.ts +51 -4
  308. package/hmr/server/websocket-core-bridge.js +62 -54
  309. package/hmr/server/websocket-core-bridge.js.map +1 -1
  310. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  311. package/hmr/server/websocket-css-hot-update.js +65 -0
  312. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  313. package/hmr/server/websocket-device-transform.d.ts +3 -0
  314. package/hmr/server/websocket-device-transform.js +7 -0
  315. package/hmr/server/websocket-device-transform.js.map +1 -0
  316. package/hmr/server/websocket-hmr-pending.d.ts +3 -9
  317. package/hmr/server/websocket-hmr-pending.js +1 -1
  318. package/hmr/server/websocket-hmr-pending.js.map +1 -1
  319. package/hmr/server/websocket-hot-update.d.ts +77 -0
  320. package/hmr/server/websocket-hot-update.js +360 -0
  321. package/hmr/server/websocket-hot-update.js.map +1 -0
  322. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  323. package/hmr/server/websocket-import-map-route.js +50 -0
  324. package/hmr/server/websocket-import-map-route.js.map +1 -0
  325. package/hmr/server/websocket-module-bindings.js +3 -3
  326. package/hmr/server/websocket-module-bindings.js.map +1 -1
  327. package/hmr/server/websocket-module-specifiers.d.ts +66 -2
  328. package/hmr/server/websocket-module-specifiers.js +191 -20
  329. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  330. package/hmr/server/websocket-ns-core.d.ts +34 -0
  331. package/hmr/server/websocket-ns-core.js +414 -0
  332. package/hmr/server/websocket-ns-core.js.map +1 -0
  333. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  334. package/hmr/server/websocket-ns-entry.js +164 -0
  335. package/hmr/server/websocket-ns-entry.js.map +1 -0
  336. package/hmr/server/websocket-ns-m-paths.d.ts +1 -3
  337. package/hmr/server/websocket-ns-m-paths.js +25 -82
  338. package/hmr/server/websocket-ns-m-paths.js.map +1 -1
  339. package/hmr/server/websocket-ns-m-request.d.ts +11 -1
  340. package/hmr/server/websocket-ns-m-request.js +17 -9
  341. package/hmr/server/websocket-ns-m-request.js.map +1 -1
  342. package/hmr/server/websocket-ns-m.d.ts +52 -0
  343. package/hmr/server/websocket-ns-m.js +835 -0
  344. package/hmr/server/websocket-ns-m.js.map +1 -0
  345. package/hmr/server/websocket-served-module-helpers.d.ts +50 -4
  346. package/hmr/server/websocket-served-module-helpers.js +384 -86
  347. package/hmr/server/websocket-served-module-helpers.js.map +1 -1
  348. package/hmr/server/websocket-txn.js +6 -9
  349. package/hmr/server/websocket-txn.js.map +1 -1
  350. package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
  351. package/hmr/server/websocket-vendor-unifier.js +4 -9
  352. package/hmr/server/websocket-vendor-unifier.js.map +1 -1
  353. package/hmr/server/websocket.d.ts +7 -39
  354. package/hmr/server/websocket.js +643 -6716
  355. package/hmr/server/websocket.js.map +1 -1
  356. package/hmr/shared/ns-globals.d.ts +108 -0
  357. package/hmr/shared/ns-globals.js +28 -0
  358. package/hmr/shared/ns-globals.js.map +1 -0
  359. package/hmr/shared/protocol.d.ts +145 -0
  360. package/hmr/shared/protocol.js +28 -0
  361. package/hmr/shared/protocol.js.map +1 -0
  362. package/hmr/shared/runtime/boot-archive-format.d.ts +16 -0
  363. package/hmr/shared/runtime/boot-archive-format.js +31 -0
  364. package/hmr/shared/runtime/boot-archive-format.js.map +1 -0
  365. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  366. package/hmr/shared/runtime/boot-complete.js +32 -0
  367. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  368. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  369. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  370. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  371. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  372. package/hmr/shared/runtime/boot-progress.js +134 -0
  373. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  374. package/hmr/shared/runtime/boot-timeline.d.ts +2 -1
  375. package/hmr/shared/runtime/boot-timeline.js +9 -22
  376. package/hmr/shared/runtime/boot-timeline.js.map +1 -1
  377. package/hmr/shared/runtime/browser-runtime-contract.d.ts +53 -22
  378. package/hmr/shared/runtime/browser-runtime-contract.js +6 -9
  379. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
  380. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  381. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  382. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  383. package/hmr/shared/runtime/dev-overlay.d.ts +76 -30
  384. package/hmr/shared/runtime/dev-overlay.js +767 -408
  385. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  386. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  387. package/hmr/shared/runtime/global-scope.js +21 -0
  388. package/hmr/shared/runtime/global-scope.js.map +1 -0
  389. package/hmr/shared/runtime/hooks.js +2 -1
  390. package/hmr/shared/runtime/hooks.js.map +1 -1
  391. package/hmr/shared/runtime/http-only-boot.js +7 -6
  392. package/hmr/shared/runtime/http-only-boot.js.map +1 -1
  393. package/hmr/shared/runtime/module-provenance.js +4 -6
  394. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  395. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  396. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  397. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  398. package/hmr/shared/runtime/root-placeholder.js +398 -204
  399. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  400. package/hmr/shared/runtime/session-bootstrap.js +274 -55
  401. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  402. package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
  403. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  404. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  405. package/hmr/shared/vendor/manifest-collect.js +549 -0
  406. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  407. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  408. package/hmr/shared/vendor/manifest-loader.js +5 -3
  409. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  410. package/hmr/shared/vendor/manifest.d.ts +1 -7
  411. package/hmr/shared/vendor/manifest.js +136 -825
  412. package/hmr/shared/vendor/manifest.js.map +1 -1
  413. package/hmr/shared/vendor/registry.d.ts +2 -0
  414. package/hmr/shared/vendor/registry.js +14 -0
  415. package/hmr/shared/vendor/registry.js.map +1 -1
  416. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  417. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  418. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  419. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +76 -0
  420. package/hmr/shared/vendor/vendor-esbuild-plugins.js +401 -0
  421. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  422. package/hmr/vendor-bootstrap.d.ts +1 -3
  423. package/hmr/vendor-bootstrap.js +4 -6
  424. package/hmr/vendor-bootstrap.js.map +1 -1
  425. package/index.d.ts +1 -0
  426. package/index.js +5 -0
  427. package/index.js.map +1 -1
  428. package/package.json +65 -11
  429. package/runtime/core-aliases-early.js +25 -55
  430. package/runtime/core-aliases-early.js.map +1 -1
  431. package/shims/react-jsx-runtime.d.ts +4 -0
  432. package/shims/react-jsx-runtime.js +61 -0
  433. package/shims/react-jsx-runtime.js.map +1 -0
  434. package/helpers/angular/angular-linker.d.ts +0 -13
  435. package/helpers/angular/angular-linker.js +0 -194
  436. package/helpers/angular/angular-linker.js.map +0 -1
  437. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  438. package/helpers/angular/shared-linker.d.ts +0 -11
  439. package/helpers/angular/shared-linker.js +0 -75
  440. package/helpers/angular/shared-linker.js.map +0 -1
  441. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  442. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  443. package/helpers/angular/util.js +0 -67
  444. package/helpers/angular/util.js.map +0 -1
  445. package/helpers/prelink-angular.d.ts +0 -2
  446. package/helpers/prelink-angular.js +0 -117
  447. package/helpers/prelink-angular.js.map +0 -1
  448. package/hmr/server/websocket-angular-entry.js.map +0 -1
  449. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  450. package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
  451. package/hmr/server/websocket-ns-m-finalize.js +0 -88
  452. package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
  453. package/hmr/server/websocket-runtime-compat.d.ts +0 -19
  454. package/hmr/server/websocket-runtime-compat.js +0 -286
  455. package/hmr/server/websocket-runtime-compat.js.map +0 -1
  456. package/hmr/server/websocket-vue-sfc.d.ts +0 -27
  457. package/hmr/server/websocket-vue-sfc.js +0 -1114
  458. package/hmr/server/websocket-vue-sfc.js.map +0 -1
  459. package/transformers/NativeClass/index.d.ts +0 -2
  460. package/transformers/NativeClass/index.js +0 -222
  461. package/transformers/NativeClass/index.js.map +0 -1
  462. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  463. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  464. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  465. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -2,6 +2,7 @@ import path from 'path';
2
2
  import fs from 'fs';
3
3
  import { getProjectRootPath } from './project.js';
4
4
  import { findPackageInNodeModules } from './module-resolution.js';
5
+ import { resolveMainFieldPlatformVariant } from './resolve-main-field-platform.js';
5
6
  const projectRoot = getProjectRootPath();
6
7
  // Cache for package resolution results
7
8
  const packageCache = new Map();
@@ -53,66 +54,16 @@ export function nativescriptPackageResolver(platform) {
53
54
  if (fs.existsSync(packageJsonPath)) {
54
55
  try {
55
56
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
56
- const mainField = packageJson.main;
57
- if (mainField) {
58
- const mainFilePath = path.join(packagePath, mainField);
59
- // Case 1: Main field has no extension - try to add extensions
60
- if (!mainField.includes('.')) {
61
- // Try platform-specific file first
62
- const platformFile = path.join(packagePath, `${mainField}.${platform}.js`);
63
- if (fs.existsSync(platformFile)) {
64
- const result = {
65
- id: platformFile,
66
- resolvedBy: 'nativescript-package-resolver',
67
- };
68
- packageCache.set(packageName, result);
69
- // console.log(
70
- // `🔧 Package resolver: ${packageName} -> ${mainField}.${platform}.js (extensionless)`,
71
- // );
72
- return result;
73
- }
74
- // Fallback to .js
75
- const jsFile = path.join(packagePath, `${mainField}.js`);
76
- if (fs.existsSync(jsFile)) {
77
- const result = {
78
- id: jsFile,
79
- resolvedBy: 'nativescript-package-resolver',
80
- };
81
- packageCache.set(packageName, result);
82
- // console.log(
83
- // `🔧 Package resolver: ${packageName} -> ${mainField}.js (extensionless)`,
84
- // );
85
- return result;
86
- }
87
- }
88
- // Case 2: Main field has extension but file doesn't exist - look for platform variants
89
- else if (!fs.existsSync(mainFilePath)) {
90
- // Extract base name and extension
91
- const ext = path.extname(mainField);
92
- const baseName = mainField.slice(0, -ext.length);
93
- // Try platform-specific file first
94
- const platformFile = path.join(packagePath, `${baseName}.${platform}${ext}`);
95
- if (fs.existsSync(platformFile)) {
96
- const result = {
97
- id: platformFile,
98
- resolvedBy: 'nativescript-package-resolver',
99
- };
100
- packageCache.set(packageName, result);
101
- // console.log(
102
- // `🔧 Package resolver: ${packageName} -> ${baseName}.${platform}${ext} (missing main)`,
103
- // );
104
- return result;
105
- }
106
- // Cache as null - no platform variant found
107
- packageCache.set(packageName, null);
108
- return null;
109
- }
110
- else {
111
- // Main file exists - let normal resolution handle it
112
- packageCache.set(packageName, null);
113
- return null;
114
- }
57
+ // Shared main-field platform-variant rules (Case 1/2). Returns a
58
+ // normalizeModuleId-canonical id, or null when no rewrite applies.
59
+ const resolved = resolveMainFieldPlatformVariant(packagePath, packageJson.main, platform);
60
+ if (resolved) {
61
+ const result = { id: resolved, resolvedBy: 'nativescript-package-resolver' };
62
+ packageCache.set(packageName, result);
63
+ return result;
115
64
  }
65
+ packageCache.set(packageName, null);
66
+ return null;
116
67
  }
117
68
  catch (e) {
118
69
  // Cache as null on error
@@ -131,9 +82,6 @@ export function nativescriptPackageResolver(platform) {
131
82
  packageCache.set(packageName, null);
132
83
  return null;
133
84
  }
134
- // Cache as null and return null
135
- packageCache.set(packageName, null);
136
- return null;
137
85
  },
138
86
  };
139
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nativescript-package-resolver.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/nativescript-package-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,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AAW,EAAE,MAAM,CAAC,CAAC;oCAEtC,iBAAiB;oCACjB,6FAA6F;oCAC7F,OAAO;oCACP,OAAO,MAAM,CAAC;gCACf,CAAC;gCAED,4CAA4C;gCAC5C,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gCACpC,OAAO,IAAI,CAAC;4BACb,CAAC;iCAAM,CAAC;gCACP,qDAAqD;gCACrD,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gCACpC,OAAO,IAAI,CAAC;4BACb,CAAC;wBACF,CAAC;oBACF,CAAC;oBAAC,OAAO,CAAC,EAAE,CAAC;wBACZ,yBAAyB;wBACzB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;wBACpC,OAAO,IAAI,CAAC;oBACb,CAAC;gBACF,CAAC;qBAAM,CAAC;oBACP,wBAAwB;oBACxB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;oBACpC,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,wBAAwB;gBACxB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACb,CAAC;YAED,gCAAgC;YAChC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"nativescript-package-resolver.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/nativescript-package-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE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ACzB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;wBACpC,OAAO,IAAI,CAAC;oBACb,CAAC;gBACF,CAAC;qBAAM,CAAC;oBACP,wBAAwB;oBACxB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;oBACpC,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,wBAAwB;gBACxB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACb,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Canonicalize a filesystem path so it can serve as a STABLE Rolldown module id
3
+ * that is identical regardless of the host operating system.
4
+ *
5
+ * Why this exists
6
+ * ---------------
7
+ * Rolldown keys its module graph on the raw `resolveId` string. It does NOT
8
+ * unify `C:\proj\node_modules\@nativescript\core\ui\index.js` with
9
+ * `C:/proj/node_modules/@nativescript/core/ui/index.js`, nor `c:/…` with
10
+ * `C:/…`. Any two ids that point at the same physical file but differ in
11
+ * separator style or drive-letter case become two distinct modules — so the
12
+ * file is evaluated twice.
13
+ *
14
+ * NativeScript ships several `enforce: 'pre'` resolver plugins
15
+ * (`NativeScriptPlugin`, `nativescriptPackageResolver`,
16
+ * `packagePlatformResolverPlugin`, the tsconfig-paths resolver). They all build
17
+ * ids with Node's `path.resolve`/`path.join`, which on Windows emit
18
+ * backslashes and inherit the drive-letter case of `process.cwd()`. Meanwhile
19
+ * Vite's alias replacement (`NS_CORE_ROOT`) and Vite's own resolver emit
20
+ * forward-slash ids whose drive case comes from `require.resolve()`/realpath.
21
+ *
22
+ * The result on Windows: `@nativescript/core`'s internal relative imports
23
+ * (resolved by our plugins → backslashes) and the same files reached via bare
24
+ * `@nativescript/core/*` specifiers (resolved by the alias → forward slashes)
25
+ * produce different ids, core is bundled twice, and the second
26
+ * `widthProperty.register(View)` crashes on a non-configurable property.
27
+ *
28
+ * macOS/Linux never hit this because POSIX paths from every code path are
29
+ * already byte-identical — which is exactly why this normalization is a no-op
30
+ * there.
31
+ *
32
+ * Canonical form
33
+ * --------------
34
+ * - forward slashes (the form Vite/Rolldown and our alias replacement use)
35
+ * - uppercase Windows drive letter, matching Node's `realpath()`/
36
+ * `require.resolve()` convention — the source that seeds `NS_CORE_ROOT`.
37
+ *
38
+ * Virtual ids (`\0…`, `virtual:…`), query suffixes (`?worker`), and bare
39
+ * specifiers are preserved as-is apart from separator/drive canonicalization,
40
+ * so it is safe to call on any string a `resolveId` hook might return.
41
+ */
42
+ export declare function normalizeModuleId(id: string): string;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Canonicalize a filesystem path so it can serve as a STABLE Rolldown module id
3
+ * that is identical regardless of the host operating system.
4
+ *
5
+ * Why this exists
6
+ * ---------------
7
+ * Rolldown keys its module graph on the raw `resolveId` string. It does NOT
8
+ * unify `C:\proj\node_modules\@nativescript\core\ui\index.js` with
9
+ * `C:/proj/node_modules/@nativescript/core/ui/index.js`, nor `c:/…` with
10
+ * `C:/…`. Any two ids that point at the same physical file but differ in
11
+ * separator style or drive-letter case become two distinct modules — so the
12
+ * file is evaluated twice.
13
+ *
14
+ * NativeScript ships several `enforce: 'pre'` resolver plugins
15
+ * (`NativeScriptPlugin`, `nativescriptPackageResolver`,
16
+ * `packagePlatformResolverPlugin`, the tsconfig-paths resolver). They all build
17
+ * ids with Node's `path.resolve`/`path.join`, which on Windows emit
18
+ * backslashes and inherit the drive-letter case of `process.cwd()`. Meanwhile
19
+ * Vite's alias replacement (`NS_CORE_ROOT`) and Vite's own resolver emit
20
+ * forward-slash ids whose drive case comes from `require.resolve()`/realpath.
21
+ *
22
+ * The result on Windows: `@nativescript/core`'s internal relative imports
23
+ * (resolved by our plugins → backslashes) and the same files reached via bare
24
+ * `@nativescript/core/*` specifiers (resolved by the alias → forward slashes)
25
+ * produce different ids, core is bundled twice, and the second
26
+ * `widthProperty.register(View)` crashes on a non-configurable property.
27
+ *
28
+ * macOS/Linux never hit this because POSIX paths from every code path are
29
+ * already byte-identical — which is exactly why this normalization is a no-op
30
+ * there.
31
+ *
32
+ * Canonical form
33
+ * --------------
34
+ * - forward slashes (the form Vite/Rolldown and our alias replacement use)
35
+ * - uppercase Windows drive letter, matching Node's `realpath()`/
36
+ * `require.resolve()` convention — the source that seeds `NS_CORE_ROOT`.
37
+ *
38
+ * Virtual ids (`\0…`, `virtual:…`), query suffixes (`?worker`), and bare
39
+ * specifiers are preserved as-is apart from separator/drive canonicalization,
40
+ * so it is safe to call on any string a `resolveId` hook might return.
41
+ */
42
+ export function normalizeModuleId(id) {
43
+ if (!id)
44
+ return id;
45
+ // Forward slashes everywhere. Rollup-style virtual prefixes ("\0") use a
46
+ // leading NUL, never a path separator, so this leaves them intact.
47
+ let normalized = id.replace(/\\/g, '/');
48
+ // Uppercase a leading Windows drive letter ("c:/…" → "C:/…"). Matches the
49
+ // case Node's realpath()/require.resolve() returns, which is what feeds
50
+ // NS_CORE_ROOT and therefore every alias-resolved core id.
51
+ if (normalized.length >= 2 && normalized[1] === ':') {
52
+ const drive = normalized.charCodeAt(0);
53
+ // a-z → A-Z
54
+ if (drive >= 97 && drive <= 122) {
55
+ normalized = normalized[0].toUpperCase() + normalized.slice(1);
56
+ }
57
+ }
58
+ return normalized;
59
+ }
60
+ //# sourceMappingURL=normalize-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-id.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/normalize-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC3C,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IACnB,yEAAyE;IACzE,mEAAmE;IACnE,IAAI,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACxC,0EAA0E;IAC1E,wEAAwE;IACxE,2DAA2D;IAC3D,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACrD,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACvC,YAAY;QACZ,IAAI,KAAK,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;YACjC,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC;IACF,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC"}
@@ -1,12 +1,17 @@
1
1
  /**
2
2
  * Single canonical URL generator for `@nativescript/core` under HMR.
3
3
  *
4
- * Invariant A (HMR_CORE_REALM_DETERMINISTIC_PLAN.md):
5
- * Every public-facing reference to `@nativescript/core[/sub]` resolves to
6
- * exactly one URL string — byte-for-byte identical across every emitter
7
- * (bundle entry, external-urls plugin, rewriter, import map, runtime
8
- * require). There is no ambiguity about `?p=` vs path, `.js` vs
9
- * extensionless, versioned vs unversioned.
4
+ * Every public-facing reference to `@nativescript/core[/sub]` resolves to
5
+ * exactly one URL string — byte-for-byte identical across every emitter
6
+ * (bundle entry, external-urls plugin, rewriter, import map, runtime
7
+ * require). The only valid shapes are:
8
+ *
9
+ * - `/ns/core` — package main
10
+ * - `/ns/core/<sub>` — subpath form
11
+ *
12
+ * with `<sub>` always run through `normalizeCoreSub` (extensionless, no
13
+ * `/index` tail, no platform suffix). There is no version segment, no
14
+ * `?p=` query form, no `.js` tail.
10
15
  *
11
16
  * This module is the ONE site that constructs those URLs. Every caller in
12
17
  * the repo should use `buildCoreUrl()` (or `buildCoreUrlPath()` when origin
@@ -59,7 +64,6 @@ export declare function isCoreBridgeUrl(input: string): boolean;
59
64
  * 'http://localhost:5173/ns/core' → ''
60
65
  * 'http://localhost:5173/ns/core/application' → 'application'
61
66
  * '/ns/core/ui/core/view' → 'ui/core/view'
62
- * '/ns/core?p=foo' → 'foo' (legacy form tolerated)
63
67
  * 'http://example.com/other' → null
64
68
  */
65
69
  export declare function extractCoreSub(input: string): string | null;
@@ -74,6 +78,24 @@ export declare function extractCoreSub(input: string): string | null;
74
78
  * '/foo/bar/baz' → null
75
79
  */
76
80
  export declare function specToCoreSub(spec: string): string | null;
81
+ /**
82
+ * Convert an absolute path INSIDE a known @nativescript/core root directory
83
+ * into the canonical sub path. Complements {@link specToCoreSub}, which only
84
+ * recognizes bare specifiers and `node_modules` installs: in a monorepo where
85
+ * core is consumed from source (`<workspace>/packages/core` via a `file:`
86
+ * dependency), the resolve-alias step rewrites bare `@nativescript/core[/sub]`
87
+ * specifiers to absolute paths under that source root BEFORE the
88
+ * `ns-core-external-urls` build plugin sees them. Without this mapping those
89
+ * paths escape externalization and the entire core library is inlined into
90
+ * bundle.mjs — a dead second realm whose `Frame.topmost()` is undefined while
91
+ * the dev-server-served realm owns the live UI.
92
+ *
93
+ * corePathToSub('/ws/packages/core', '/ws/packages/core') → ''
94
+ * corePathToSub('/ws/packages/core/ui/frame', '/ws/packages/core') → 'ui/frame'
95
+ * corePathToSub('/ws/packages/core/ui/frame/index.ios.ts', same root) → 'ui/frame'
96
+ * corePathToSub('/elsewhere/file.ts', '/ws/packages/core') → null
97
+ */
98
+ export declare function corePathToSub(spec: string, coreRoot: string | null | undefined): string | null;
77
99
  /**
78
100
  * Produce the set of "runtime module id" strings we expose in
79
101
  * `globalThis.__NS_CORE_MODULES__` for a given sub. Callers of the vendor
@@ -1,12 +1,17 @@
1
1
  /**
2
2
  * Single canonical URL generator for `@nativescript/core` under HMR.
3
3
  *
4
- * Invariant A (HMR_CORE_REALM_DETERMINISTIC_PLAN.md):
5
- * Every public-facing reference to `@nativescript/core[/sub]` resolves to
6
- * exactly one URL string — byte-for-byte identical across every emitter
7
- * (bundle entry, external-urls plugin, rewriter, import map, runtime
8
- * require). There is no ambiguity about `?p=` vs path, `.js` vs
9
- * extensionless, versioned vs unversioned.
4
+ * Every public-facing reference to `@nativescript/core[/sub]` resolves to
5
+ * exactly one URL string — byte-for-byte identical across every emitter
6
+ * (bundle entry, external-urls plugin, rewriter, import map, runtime
7
+ * require). The only valid shapes are:
8
+ *
9
+ * - `/ns/core` — package main
10
+ * - `/ns/core/<sub>` — subpath form
11
+ *
12
+ * with `<sub>` always run through `normalizeCoreSub` (extensionless, no
13
+ * `/index` tail, no platform suffix). There is no version segment, no
14
+ * `?p=` query form, no `.js` tail.
10
15
  *
11
16
  * This module is the ONE site that constructs those URLs. Every caller in
12
17
  * the repo should use `buildCoreUrl()` (or `buildCoreUrlPath()` when origin
@@ -35,6 +40,29 @@ export function normalizeCoreSub(sub) {
35
40
  let s = String(sub).split('?')[0].split('#')[0].trim();
36
41
  s = s.replace(/^\/+/, '').replace(/\/+$/, '');
37
42
  s = s.replace(/\.(?:mjs|cjs|js)$/, '');
43
+ // Strip a trailing platform suffix (`.ios` / `.android` / `.visionos`)
44
+ // so Vite-resolved platform-specific file paths canonicalize to the
45
+ // same form the runtime import map uses for the bare subpath.
46
+ //
47
+ // Why this matters: when the app source has
48
+ // `import { TextBase } from '@nativescript/core/ui/text-base'`, Vite's
49
+ // alias + extension resolver picks `ui/text-base/index.ios.js`. After
50
+ // `.js` is stripped above we have `ui/text-base/index.ios`. Vendor
51
+ // code, by contrast, takes the bare specifier path: the runtime
52
+ // import map's `@nativescript/core/` prefix maps it to
53
+ // `/ns/core/ui/text-base` directly (no `.ios`). The iOS HTTP ESM
54
+ // loader caches by URL string, so two spellings of the same file
55
+ // would produce two distinct V8 module records, re-evaluate
56
+ // `TextBase`, and create a realm split that leaves the
57
+ // `@nativescript-community` plugin's `setTextDecorationAndTransform`
58
+ // override visible to vendor code but invisible to the app.
59
+ //
60
+ // Stripping the suffix here normalises both shapes — `ui/text-base/`
61
+ // `index.ios` and `runtime/runtime.ios` — to the bare form. The
62
+ // trailing `/index` handler below then collapses
63
+ // `ui/text-base/index` → `ui/text-base`, and the final `index`
64
+ // guard collapses the package-main case to ''.
65
+ s = s.replace(/\.(?:ios|android|visionos)$/, '');
38
66
  // Strip trailing `/index` so that `globals/index` → `globals`, matching
39
67
  // the bare import form that consumers spell as `@nativescript/core/globals`.
40
68
  // The main module case (`index` alone) is handled below.
@@ -81,14 +109,13 @@ export function buildCoreUrl(origin, sub) {
81
109
  export function isCoreBridgeUrl(input) {
82
110
  if (!input)
83
111
  return false;
84
- return /\/ns\/core(?:\/|$|\?)/.test(input);
112
+ return /\/ns\/core(?:\/|$)/.test(input);
85
113
  }
86
114
  /**
87
115
  * Extract the canonical sub path from a /ns/core URL.
88
116
  * 'http://localhost:5173/ns/core' → ''
89
117
  * 'http://localhost:5173/ns/core/application' → 'application'
90
118
  * '/ns/core/ui/core/view' → 'ui/core/view'
91
- * '/ns/core?p=foo' → 'foo' (legacy form tolerated)
92
119
  * 'http://example.com/other' → null
93
120
  */
94
121
  export function extractCoreSub(input) {
@@ -97,14 +124,10 @@ export function extractCoreSub(input) {
97
124
  try {
98
125
  const u = new URL(input, 'http://placeholder.invalid');
99
126
  const pathname = u.pathname;
100
- const pRaw = u.searchParams.get('p');
101
- if (pRaw)
102
- return normalizeCoreSub(pRaw);
103
127
  const afterCore = pathname.replace(/^.*\/ns\/core(?:\/|$)/, '');
104
128
  return normalizeCoreSub(afterCore);
105
129
  }
106
130
  catch {
107
- // Fall back to literal parsing if URL constructor fails
108
131
  const m = input.match(/\/ns\/core(?:\/([^?#]*))?/);
109
132
  if (!m)
110
133
  return null;
@@ -139,6 +162,40 @@ export function specToCoreSub(spec) {
139
162
  }
140
163
  return null;
141
164
  }
165
+ /**
166
+ * Convert an absolute path INSIDE a known @nativescript/core root directory
167
+ * into the canonical sub path. Complements {@link specToCoreSub}, which only
168
+ * recognizes bare specifiers and `node_modules` installs: in a monorepo where
169
+ * core is consumed from source (`<workspace>/packages/core` via a `file:`
170
+ * dependency), the resolve-alias step rewrites bare `@nativescript/core[/sub]`
171
+ * specifiers to absolute paths under that source root BEFORE the
172
+ * `ns-core-external-urls` build plugin sees them. Without this mapping those
173
+ * paths escape externalization and the entire core library is inlined into
174
+ * bundle.mjs — a dead second realm whose `Frame.topmost()` is undefined while
175
+ * the dev-server-served realm owns the live UI.
176
+ *
177
+ * corePathToSub('/ws/packages/core', '/ws/packages/core') → ''
178
+ * corePathToSub('/ws/packages/core/ui/frame', '/ws/packages/core') → 'ui/frame'
179
+ * corePathToSub('/ws/packages/core/ui/frame/index.ios.ts', same root) → 'ui/frame'
180
+ * corePathToSub('/elsewhere/file.ts', '/ws/packages/core') → null
181
+ */
182
+ export function corePathToSub(spec, coreRoot) {
183
+ if (!spec || !coreRoot)
184
+ return null;
185
+ const cleaned = spec.split('?')[0].split('#')[0].replace(/\\/g, '/');
186
+ const root = String(coreRoot).replace(/\\/g, '/').replace(/\/+$/, '');
187
+ if (!root)
188
+ return null;
189
+ if (cleaned === root)
190
+ return '';
191
+ if (!cleaned.startsWith(root + '/'))
192
+ return null;
193
+ // Monorepo core is TypeScript source; strip TS extensions before the
194
+ // canonical normalizer (which handles .js/.mjs/.cjs, platform suffixes
195
+ // and trailing /index).
196
+ const rel = cleaned.slice(root.length + 1).replace(/\.(?:ts|tsx|mts|cts)$/, '');
197
+ return normalizeCoreSub(rel);
198
+ }
142
199
  /**
143
200
  * Produce the set of "runtime module id" strings we expose in
144
201
  * `globalThis.__NS_CORE_MODULES__` for a given sub. Callers of the vendor
@@ -1 +1 @@
1
- {"version":3,"file":"ns-core-url.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/ns-core-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAE/C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAmB;IACnD,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IA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IACd,CAAC;SAAM,CAAC;QACP,IAAI,CAAC,GAAG,CAAC,GAAG,iBAAiB,IAAI,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,gEAAgE;QAChE,IAAI,CAAC,GAAG,CAAC,GAAG,iBAAiB,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,0CAA0C;QAC1C,IAAI,CAAC,GAAG,CAAC,GAAG,iBAAiB,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,CAAC,GAAG,iBAAiB,IAAI,CAAC,WAAW,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Canonical list of packages that must NEVER be pre-bundled by Vite's
3
+ * dependency scanner.
4
+ *
5
+ * The most load-bearing entries are `module` / `node:module`: they are aliased
6
+ * to local polyfills/shims (see `helpers/css-tree.ts` and the `node:module`
7
+ * alias in `configuration/base.ts`). Vite's depscanner has no awareness of those
8
+ * aliases and, if allowed to pre-bundle them, the HMR `/ns/m/` pipeline can't map
9
+ * the pre-bundle URL back to a real package — dropping the
10
+ * `import { createRequire } from 'module'` line and crashing on device with
11
+ * `ReferenceError: createRequire is not defined` inside `css-tree`.
12
+ *
13
+ * Centralized here so base/angular configs share one source of truth instead of
14
+ * hand-maintaining divergent copies.
15
+ */
16
+ export declare const NS_OPTIMIZE_DEPS_EXCLUDE: readonly ["@nativescript/core", "@valor/nativescript-websockets", "set-value", "react", "react-reconciler", "react-nativescript", "module", "node:module"];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Canonical list of packages that must NEVER be pre-bundled by Vite's
3
+ * dependency scanner.
4
+ *
5
+ * The most load-bearing entries are `module` / `node:module`: they are aliased
6
+ * to local polyfills/shims (see `helpers/css-tree.ts` and the `node:module`
7
+ * alias in `configuration/base.ts`). Vite's depscanner has no awareness of those
8
+ * aliases and, if allowed to pre-bundle them, the HMR `/ns/m/` pipeline can't map
9
+ * the pre-bundle URL back to a real package — dropping the
10
+ * `import { createRequire } from 'module'` line and crashing on device with
11
+ * `ReferenceError: createRequire is not defined` inside `css-tree`.
12
+ *
13
+ * Centralized here so base/angular configs share one source of truth instead of
14
+ * hand-maintaining divergent copies.
15
+ */
16
+ export const NS_OPTIMIZE_DEPS_EXCLUDE = ['@nativescript/core', '@valor/nativescript-websockets', 'set-value', 'react', 'react-reconciler', 'react-nativescript', 'module', 'node:module'];
17
+ //# sourceMappingURL=optimize-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimize-deps.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/optimize-deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,oBAAoB,EAAE,gCAAgC,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,aAAa,CAAU,CAAC"}
@@ -2,10 +2,19 @@ import path from 'path';
2
2
  import fs from 'fs';
3
3
  import { findPackageInNodeModules } from './module-resolution.js';
4
4
  import { getProjectRootPath } from './project.js';
5
+ import { resolveMainFieldPlatformVariant } from './resolve-main-field-platform.js';
5
6
  const projectRoot = getProjectRootPath();
6
7
  export function packagePlatformResolverPlugin(opts) {
7
8
  // packages used via core transient dependencies and other vite support
8
9
  const commonSkips = ['source-map-js', 'html-entities', 'fast-xml-parser', '@valor/nativescript-websockets'];
10
+ // Memoize the resolved id (or null) per bare package name. This runs on the
11
+ // hot `enforce:'pre'` path for EVERY bare specifier; without a cache it does
12
+ // a full `findPackageInNodeModules` fs-walk + `package.json` read/parse on
13
+ // every resolve. The platform is fixed for this plugin instance (a fresh
14
+ // instance is created per worker build via the `worker.plugins` factory), so
15
+ // the package name is a sufficient key. Mirrors the cache in
16
+ // `nativescript-package-resolver.ts`.
17
+ const resolveCache = new Map();
9
18
  return {
10
19
  name: 'ns-package-platform-resolver',
11
20
  enforce: 'pre',
@@ -24,58 +33,34 @@ export function packagePlatformResolverPlugin(opts) {
24
33
  }
25
34
  // Only handle packages that exist in node_modules (real npm packages)
26
35
  const packageName = id;
27
- const packagePath = findPackageInNodeModules(packageName, projectRoot);
28
- if (packagePath) {
36
+ if (resolveCache.has(packageName)) {
37
+ return resolveCache.get(packageName);
38
+ }
39
+ // Compute once, then memoize (incl. the null "no rewrite" result so a
40
+ // known package short-circuits on the next resolve).
41
+ const resolved = (() => {
42
+ const packagePath = findPackageInNodeModules(packageName, projectRoot);
43
+ if (!packagePath)
44
+ return null;
29
45
  const packageJsonPath = path.join(packagePath, 'package.json');
30
- if (fs.existsSync(packageJsonPath)) {
31
- try {
32
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
33
- const mainField = packageJson.main;
34
- if (mainField) {
35
- const mainFilePath = path.join(packagePath, mainField);
36
- // Case 1: Main field has no extension - try to add extensions
37
- if (!mainField.includes('.')) {
38
- // Try platform-specific file first
39
- const platformFile = path.join(packagePath, `${mainField}.${opts.platform}.js`);
40
- if (fs.existsSync(platformFile)) {
41
- if (opts.verbose) {
42
- console.log(`✅ Alias resolver: ${packageName} -> ${mainField}.${opts.platform}.js (extensionless)`);
43
- }
44
- return platformFile;
45
- }
46
- // Fallback to .js
47
- const jsFile = path.join(packagePath, `${mainField}.js`);
48
- if (fs.existsSync(jsFile)) {
49
- if (opts.verbose) {
50
- console.log(`✅ Alias resolver: ${packageName} -> ${mainField}.js (extensionless)`);
51
- }
52
- return jsFile;
53
- }
54
- }
55
- // Case 2: Main field has extension but file doesn't exist - look for platform variants
56
- else if (!fs.existsSync(mainFilePath)) {
57
- // Extract base name and extension
58
- const ext = path.extname(mainField);
59
- const baseName = mainField.slice(0, -ext.length);
60
- // Try platform-specific file first
61
- const platformFile = path.join(packagePath, `${baseName}.${opts.platform}${ext}`);
62
- if (fs.existsSync(platformFile)) {
63
- if (opts.verbose) {
64
- console.log(`✅ Alias resolver: ${packageName} -> ${baseName}.${opts.platform}${ext} (missing main)`);
65
- }
66
- return platformFile;
67
- }
68
- // If main file exists, let normal resolution handle it
69
- // If it doesn't exist and no platform variant found, let it fail naturally
70
- }
71
- }
72
- }
73
- catch (e) {
74
- // Ignore parse errors and fall through
46
+ if (!fs.existsSync(packageJsonPath))
47
+ return null;
48
+ try {
49
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
50
+ // Shared main-field platform-variant rules (Case 1/2).
51
+ const out = resolveMainFieldPlatformVariant(packagePath, packageJson.main, opts.platform);
52
+ if (out && opts.verbose) {
53
+ console.log(`✅ Alias resolver: ${packageName} -> ${out}`);
75
54
  }
55
+ return out;
76
56
  }
77
- }
78
- return null;
57
+ catch {
58
+ // Ignore parse errors and fall through.
59
+ return null;
60
+ }
61
+ })();
62
+ resolveCache.set(packageName, resolved);
63
+ return resolved;
79
64
  },
80
65
  };
81
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"package-platform-aliases.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/package-platform-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;AAEzC,MAAM,UAAU,6BAA6B,CAAC,IAAoG;IACjJ,uEAAuE;IACvE,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,gCAAgC,CAAC,CAAC;IAC5G,OAAO;QACN,IAAI,EAAE,8B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,iBAAiB,CAAC,CAAC;oCACtG,CAAC;oCACD,OAAO,YAAY,CAAC;gCACrB,CAAC;gCAED,uDAAuD;gCACvD,2EAA2E;4BAC5E,CAAC;wBACF,CAAC;oBACF,CAAC;oBAAC,OAAO,CAAC,EAAE,CAAC;wBACZ,uCAAuC;oBACxC,CAAC;gBACF,CAAC;YACF,CAAC;YAED,OAAO,IAAI,CAAC;QACb,CAAC;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"package-platform-aliases.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/package-platform-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAEnF,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;AAEzC,MAAM,UAAU,6BAA6B,CAAC,IAAoG;IACjJ,uEAAuE;IACvE,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,gCAAgC,CAAC,CAAC;IAC5G,4EAA4E;IAC5E,6EAA6E;IAC7E,2EAA2E;IAC3E,yEAAyE;IACzE,6EAA6E;IAC7E,6DAA6D;IAC7D,sCAAsC;IACtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAyB,CAAC;IACtD,OAAO;QACN,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,KAAK;QACd,SAAS,CAAC,EAAE;YACX,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC3C,OAAO,IAAI,CAAC;YACb,CAAC;YACD,yCAAyC;YACzC,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC9B,OAAO,IA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;YACF,CAAC,CAAC,EAAE,CAAC;YAEL,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;QACjB,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** The platforms NativeScript builds for. Single source of truth for the build pipeline. */
2
+ export type Platform = 'android' | 'ios' | 'visionos';
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=platform-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-types.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/platform-types.ts"],"names":[],"mappings":""}
@@ -5,7 +5,23 @@ interface PostCssConfigOptions {
5
5
  postcssImport: any;
6
6
  }
7
7
  /**
8
- * Builds PostCSS configuration with platform import rewriting + postcss-import fallback.
8
+ * Builds PostCSS configuration with a platform-aware postcss-import fallback.
9
+ *
10
+ * Reality check under Vite 8: whenever the compiled CSS still contains
11
+ * `@import`, Vite UNSHIFTS its own bundled postcss-import ahead of every
12
+ * user plugin in this config — so by the time these plugins run, the import
13
+ * rules have already been inlined (or the build already failed on an
14
+ * unresolvable specifier). Platform-variant rewriting (`foo.css` →
15
+ * `foo.ios.css`) therefore happens BEFORE Vite sees the CSS:
16
+ * - module pipeline: the `ns-css-platform` plugin's transform hook
17
+ * - direct `preprocessCSS()` callers: `rewritePlatformCssImports()`
18
+ * (both in helpers/css-platform-plugin.ts)
19
+ * A previous `ns-postcss-platform-import-rewrite` plugin here duplicated that
20
+ * rewrite at the postcss layer; it was unreachable and has been removed.
21
+ *
22
+ * The postcss-import fallback below is retained as defense-in-depth for
23
+ * preprocessor outputs (sass passes `@import "*.css"` through untouched) in
24
+ * case an app's plugin order ever bypasses Vite's internal inliner.
9
25
  */
10
26
  export declare function createPostCssConfig(opts: PostCssConfigOptions): "./postcss.config.js" | {
11
27
  plugins: any[];