@noodleseed/one 0.4.0 → 0.5.0

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 (369) hide show
  1. package/dist/agents.d.ts +5 -2
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js +103 -11
  4. package/dist/agents.js.map +1 -1
  5. package/dist/commands/author-loop.d.ts.map +1 -1
  6. package/dist/commands/author-loop.js +23 -1
  7. package/dist/commands/author-loop.js.map +1 -1
  8. package/dist/commands/shared.d.ts.map +1 -1
  9. package/dist/commands/shared.js +2 -1
  10. package/dist/commands/shared.js.map +1 -1
  11. package/dist/config.d.ts +1 -0
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js.map +1 -1
  14. package/dist/deploy.d.ts.map +1 -1
  15. package/dist/deploy.js +15 -3
  16. package/dist/deploy.js.map +1 -1
  17. package/dist/react-widget-build.d.ts +4 -0
  18. package/dist/react-widget-build.d.ts.map +1 -0
  19. package/dist/react-widget-build.js +176 -0
  20. package/dist/react-widget-build.js.map +1 -0
  21. package/dist/skills-update.d.ts +43 -0
  22. package/dist/skills-update.d.ts.map +1 -0
  23. package/dist/skills-update.js +191 -0
  24. package/dist/skills-update.js.map +1 -0
  25. package/dist/tunnel.d.ts +42 -0
  26. package/dist/tunnel.d.ts.map +1 -0
  27. package/dist/tunnel.js +60 -0
  28. package/dist/tunnel.js.map +1 -0
  29. package/dist/update.d.ts +1 -0
  30. package/dist/update.d.ts.map +1 -1
  31. package/dist/update.js +23 -11
  32. package/dist/update.js.map +1 -1
  33. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts +10 -0
  34. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -0
  35. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +151 -0
  36. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -0
  37. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.d.ts +2 -0
  38. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.d.ts.map +1 -0
  39. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +49 -0
  40. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js.map +1 -0
  41. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts +7 -0
  42. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -0
  43. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +108 -0
  44. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -0
  45. package/node_modules/@noodle-borg/agent-kit/dist/index.d.ts +29 -1
  46. package/node_modules/@noodle-borg/agent-kit/dist/index.d.ts.map +1 -1
  47. package/node_modules/@noodle-borg/agent-kit/dist/index.js +87 -114
  48. package/node_modules/@noodle-borg/agent-kit/dist/index.js.map +1 -1
  49. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts +17 -0
  50. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -0
  51. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +360 -0
  52. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -0
  53. package/node_modules/@noodle-borg/agent-kit/package.json +4 -2
  54. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +2 -2
  55. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts.map +1 -1
  56. package/node_modules/@noodle-borg/authoring/dist/connectors.js +4 -2
  57. package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
  58. package/node_modules/@noodle-borg/authoring/dist/customer-auth.d.ts +2 -2
  59. package/node_modules/@noodle-borg/authoring/dist/customer-auth.d.ts.map +1 -1
  60. package/node_modules/@noodle-borg/authoring/dist/customer-auth.js +6 -3
  61. package/node_modules/@noodle-borg/authoring/dist/customer-auth.js.map +1 -1
  62. package/node_modules/@noodle-borg/authoring/dist/react.d.ts.map +1 -1
  63. package/node_modules/@noodle-borg/authoring/dist/react.js +148 -9
  64. package/node_modules/@noodle-borg/authoring/dist/react.js.map +1 -1
  65. package/node_modules/@noodle-borg/authoring/package.json +3 -1
  66. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +4 -3
  67. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
  68. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +20 -9
  69. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
  70. package/node_modules/@noodle-borg/compiler/dist/widget-emit.js +2 -0
  71. package/node_modules/@noodle-borg/compiler/dist/widget-emit.js.map +1 -1
  72. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.d.ts +3 -0
  73. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.d.ts.map +1 -0
  74. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js +21 -0
  75. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js.map +1 -0
  76. package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts.map +1 -1
  77. package/node_modules/@noodle-borg/connector-defs/dist/compile.js +5 -0
  78. package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
  79. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts.map +1 -1
  80. package/node_modules/@noodle-borg/connector-defs/dist/schema.js +11 -2
  81. package/node_modules/@noodle-borg/connector-defs/dist/schema.js.map +1 -1
  82. package/node_modules/@noodle-borg/connector-defs/dist/variables.d.ts +1 -0
  83. package/node_modules/@noodle-borg/connector-defs/dist/variables.d.ts.map +1 -1
  84. package/node_modules/@noodle-borg/connector-defs/dist/variables.js +7 -0
  85. package/node_modules/@noodle-borg/connector-defs/dist/variables.js.map +1 -1
  86. package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.d.ts.map +1 -1
  87. package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.js +14 -0
  88. package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.js.map +1 -1
  89. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.d.ts +3 -0
  90. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.d.ts.map +1 -0
  91. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.js +30 -0
  92. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.js.map +1 -0
  93. package/node_modules/@noodle-borg/service/dist/credential-broker.d.ts.map +1 -1
  94. package/node_modules/@noodle-borg/service/dist/credential-broker.js +27 -6
  95. package/node_modules/@noodle-borg/service/dist/credential-broker.js.map +1 -1
  96. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.d.ts +6 -0
  97. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.d.ts.map +1 -0
  98. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.js +80 -0
  99. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.js.map +1 -0
  100. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  101. package/node_modules/@noodle-borg/service/dist/registry.js +5 -1
  102. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  103. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  104. package/node_modules/@noodle-borg/service/dist/serve.js +5 -1
  105. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  106. package/node_modules/@oxc-project/types/LICENSE +22 -0
  107. package/node_modules/@oxc-project/types/README.md +3 -0
  108. package/node_modules/@oxc-project/types/package.json +26 -0
  109. package/node_modules/@oxc-project/types/types.d.ts +1912 -0
  110. package/node_modules/@rolldown/binding-linux-x64-gnu/README.md +3 -0
  111. package/node_modules/@rolldown/binding-linux-x64-gnu/package.json +40 -0
  112. package/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node +0 -0
  113. package/node_modules/@rolldown/pluginutils/LICENSE +21 -0
  114. package/node_modules/@rolldown/pluginutils/README.md +145 -0
  115. package/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts +194 -0
  116. package/node_modules/@rolldown/pluginutils/dist/filter/index.mjs +2 -0
  117. package/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs +323 -0
  118. package/node_modules/@rolldown/pluginutils/dist/index.d.mts +2 -0
  119. package/node_modules/@rolldown/pluginutils/dist/index.mjs +2 -0
  120. package/node_modules/@rolldown/pluginutils/package.json +40 -0
  121. package/node_modules/@vitejs/plugin-react/LICENSE +21 -0
  122. package/node_modules/@vitejs/plugin-react/README.md +169 -0
  123. package/node_modules/@vitejs/plugin-react/dist/index.d.ts +48 -0
  124. package/node_modules/@vitejs/plugin-react/dist/index.js +200 -0
  125. package/node_modules/@vitejs/plugin-react/dist/refresh-runtime.js +663 -0
  126. package/node_modules/@vitejs/plugin-react/package.json +87 -0
  127. package/node_modules/@vitejs/plugin-react/types/optionalTypes.d.ts +12 -0
  128. package/node_modules/@vitejs/plugin-react/types/preamble.d.ts +1 -0
  129. package/node_modules/detect-libc/LICENSE +201 -0
  130. package/node_modules/detect-libc/README.md +163 -0
  131. package/node_modules/detect-libc/index.d.ts +14 -0
  132. package/node_modules/detect-libc/lib/detect-libc.js +313 -0
  133. package/node_modules/detect-libc/lib/elf.js +39 -0
  134. package/node_modules/detect-libc/lib/filesystem.js +51 -0
  135. package/node_modules/detect-libc/lib/process.js +24 -0
  136. package/node_modules/detect-libc/package.json +44 -0
  137. package/node_modules/fdir/LICENSE +7 -0
  138. package/node_modules/fdir/README.md +91 -0
  139. package/node_modules/fdir/dist/index.cjs +588 -0
  140. package/node_modules/fdir/dist/index.d.cts +155 -0
  141. package/node_modules/fdir/dist/index.d.mts +155 -0
  142. package/node_modules/fdir/dist/index.mjs +570 -0
  143. package/node_modules/fdir/package.json +103 -0
  144. package/node_modules/lightningcss/LICENSE +373 -0
  145. package/node_modules/lightningcss/README.md +105 -0
  146. package/node_modules/lightningcss/node/ast.d.ts +9892 -0
  147. package/node_modules/lightningcss/node/ast.js.flow +10539 -0
  148. package/node_modules/lightningcss/node/browserslistToTargets.js +48 -0
  149. package/node_modules/lightningcss/node/composeVisitors.js +450 -0
  150. package/node_modules/lightningcss/node/flags.js +28 -0
  151. package/node_modules/lightningcss/node/index.d.ts +494 -0
  152. package/node_modules/lightningcss/node/index.js +59 -0
  153. package/node_modules/lightningcss/node/index.js.flow +843 -0
  154. package/node_modules/lightningcss/node/index.mjs +4 -0
  155. package/node_modules/lightningcss/node/targets.d.ts +40 -0
  156. package/node_modules/lightningcss/node/targets.js.flow +39 -0
  157. package/node_modules/lightningcss/package.json +110 -0
  158. package/node_modules/lightningcss-linux-x64-gnu/LICENSE +373 -0
  159. package/node_modules/lightningcss-linux-x64-gnu/README.md +1 -0
  160. package/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node +0 -0
  161. package/node_modules/lightningcss-linux-x64-gnu/package.json +37 -0
  162. package/node_modules/nanoid/.claude/settings.local.json +14 -0
  163. package/node_modules/nanoid/LICENSE +20 -0
  164. package/node_modules/nanoid/README.md +39 -0
  165. package/node_modules/nanoid/async/index.browser.cjs +69 -0
  166. package/node_modules/nanoid/async/index.browser.js +34 -0
  167. package/node_modules/nanoid/async/index.cjs +71 -0
  168. package/node_modules/nanoid/async/index.d.ts +56 -0
  169. package/node_modules/nanoid/async/index.js +35 -0
  170. package/node_modules/nanoid/async/index.native.js +26 -0
  171. package/node_modules/nanoid/async/package.json +12 -0
  172. package/node_modules/nanoid/bin/nanoid.cjs +55 -0
  173. package/node_modules/nanoid/index.browser.cjs +72 -0
  174. package/node_modules/nanoid/index.browser.js +34 -0
  175. package/node_modules/nanoid/index.cjs +86 -0
  176. package/node_modules/nanoid/index.d.cts +91 -0
  177. package/node_modules/nanoid/index.d.ts +91 -0
  178. package/node_modules/nanoid/index.js +46 -0
  179. package/node_modules/nanoid/nanoid.js +1 -0
  180. package/node_modules/nanoid/non-secure/index.cjs +34 -0
  181. package/node_modules/nanoid/non-secure/index.d.ts +33 -0
  182. package/node_modules/nanoid/non-secure/index.js +21 -0
  183. package/node_modules/nanoid/non-secure/package.json +6 -0
  184. package/node_modules/nanoid/package.json +89 -0
  185. package/node_modules/nanoid/url-alphabet/index.cjs +7 -0
  186. package/node_modules/nanoid/url-alphabet/index.js +3 -0
  187. package/node_modules/nanoid/url-alphabet/package.json +6 -0
  188. package/node_modules/picocolors/LICENSE +15 -0
  189. package/node_modules/picocolors/README.md +21 -0
  190. package/node_modules/picocolors/package.json +25 -0
  191. package/node_modules/picocolors/picocolors.browser.js +4 -0
  192. package/node_modules/picocolors/picocolors.d.ts +5 -0
  193. package/node_modules/picocolors/picocolors.js +75 -0
  194. package/node_modules/picocolors/types.d.ts +51 -0
  195. package/node_modules/picomatch/LICENSE +21 -0
  196. package/node_modules/picomatch/README.md +749 -0
  197. package/node_modules/picomatch/index.js +17 -0
  198. package/node_modules/picomatch/lib/constants.js +184 -0
  199. package/node_modules/picomatch/lib/parse.js +1386 -0
  200. package/node_modules/picomatch/lib/picomatch.js +349 -0
  201. package/node_modules/picomatch/lib/scan.js +391 -0
  202. package/node_modules/picomatch/lib/utils.js +72 -0
  203. package/node_modules/picomatch/package.json +82 -0
  204. package/node_modules/picomatch/posix.js +3 -0
  205. package/node_modules/postcss/LICENSE +20 -0
  206. package/node_modules/postcss/README.md +28 -0
  207. package/node_modules/postcss/lib/at-rule.d.ts +139 -0
  208. package/node_modules/postcss/lib/at-rule.js +25 -0
  209. package/node_modules/postcss/lib/comment.d.ts +67 -0
  210. package/node_modules/postcss/lib/comment.js +13 -0
  211. package/node_modules/postcss/lib/container.d.ts +478 -0
  212. package/node_modules/postcss/lib/container.js +447 -0
  213. package/node_modules/postcss/lib/css-syntax-error.d.ts +247 -0
  214. package/node_modules/postcss/lib/css-syntax-error.js +133 -0
  215. package/node_modules/postcss/lib/declaration.d.ts +150 -0
  216. package/node_modules/postcss/lib/declaration.js +24 -0
  217. package/node_modules/postcss/lib/document.d.ts +68 -0
  218. package/node_modules/postcss/lib/document.js +33 -0
  219. package/node_modules/postcss/lib/fromJSON.d.ts +9 -0
  220. package/node_modules/postcss/lib/fromJSON.js +54 -0
  221. package/node_modules/postcss/lib/input.d.ts +226 -0
  222. package/node_modules/postcss/lib/input.js +273 -0
  223. package/node_modules/postcss/lib/lazy-result.d.ts +189 -0
  224. package/node_modules/postcss/lib/lazy-result.js +563 -0
  225. package/node_modules/postcss/lib/list.d.ts +60 -0
  226. package/node_modules/postcss/lib/list.js +58 -0
  227. package/node_modules/postcss/lib/map-generator.js +376 -0
  228. package/node_modules/postcss/lib/no-work-result.d.ts +45 -0
  229. package/node_modules/postcss/lib/no-work-result.js +137 -0
  230. package/node_modules/postcss/lib/node.d.ts +555 -0
  231. package/node_modules/postcss/lib/node.js +449 -0
  232. package/node_modules/postcss/lib/parse.d.ts +9 -0
  233. package/node_modules/postcss/lib/parse.js +42 -0
  234. package/node_modules/postcss/lib/parser.js +618 -0
  235. package/node_modules/postcss/lib/postcss.d.mts +66 -0
  236. package/node_modules/postcss/lib/postcss.d.ts +461 -0
  237. package/node_modules/postcss/lib/postcss.js +101 -0
  238. package/node_modules/postcss/lib/postcss.mjs +30 -0
  239. package/node_modules/postcss/lib/previous-map.d.ts +80 -0
  240. package/node_modules/postcss/lib/previous-map.js +161 -0
  241. package/node_modules/postcss/lib/processor.d.ts +114 -0
  242. package/node_modules/postcss/lib/processor.js +67 -0
  243. package/node_modules/postcss/lib/result.d.ts +204 -0
  244. package/node_modules/postcss/lib/result.js +42 -0
  245. package/node_modules/postcss/lib/root.d.ts +86 -0
  246. package/node_modules/postcss/lib/root.js +61 -0
  247. package/node_modules/postcss/lib/rule.d.ts +126 -0
  248. package/node_modules/postcss/lib/rule.js +27 -0
  249. package/node_modules/postcss/lib/stringifier.d.ts +45 -0
  250. package/node_modules/postcss/lib/stringifier.js +374 -0
  251. package/node_modules/postcss/lib/stringify.d.ts +9 -0
  252. package/node_modules/postcss/lib/stringify.js +11 -0
  253. package/node_modules/postcss/lib/symbols.js +5 -0
  254. package/node_modules/postcss/lib/terminal-highlight.js +70 -0
  255. package/node_modules/postcss/lib/tokenize.js +270 -0
  256. package/node_modules/postcss/lib/warn-once.js +13 -0
  257. package/node_modules/postcss/lib/warning.d.ts +146 -0
  258. package/node_modules/postcss/lib/warning.js +37 -0
  259. package/node_modules/postcss/package.json +88 -0
  260. package/node_modules/rolldown/LICENSE +25 -0
  261. package/node_modules/rolldown/README.md +11 -0
  262. package/node_modules/rolldown/bin/cli.mjs +2 -0
  263. package/node_modules/rolldown/dist/cli.d.mts +1 -0
  264. package/node_modules/rolldown/dist/cli.mjs +1202 -0
  265. package/node_modules/rolldown/dist/config.d.mts +14 -0
  266. package/node_modules/rolldown/dist/config.mjs +4 -0
  267. package/node_modules/rolldown/dist/experimental-index.d.mts +280 -0
  268. package/node_modules/rolldown/dist/experimental-index.mjs +330 -0
  269. package/node_modules/rolldown/dist/experimental-runtime-types.d.ts +107 -0
  270. package/node_modules/rolldown/dist/filter-index.d.mts +195 -0
  271. package/node_modules/rolldown/dist/filter-index.mjs +380 -0
  272. package/node_modules/rolldown/dist/get-log-filter.d.mts +3 -0
  273. package/node_modules/rolldown/dist/get-log-filter.mjs +68 -0
  274. package/node_modules/rolldown/dist/index.d.mts +4 -0
  275. package/node_modules/rolldown/dist/index.mjs +50 -0
  276. package/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +1 -0
  277. package/node_modules/rolldown/dist/parallel-plugin-worker.mjs +28 -0
  278. package/node_modules/rolldown/dist/parallel-plugin.d.mts +13 -0
  279. package/node_modules/rolldown/dist/parallel-plugin.mjs +6 -0
  280. package/node_modules/rolldown/dist/parse-ast-index.d.mts +32 -0
  281. package/node_modules/rolldown/dist/parse-ast-index.mjs +60 -0
  282. package/node_modules/rolldown/dist/plugins-index.d.mts +33 -0
  283. package/node_modules/rolldown/dist/plugins-index.mjs +40 -0
  284. package/node_modules/rolldown/dist/shared/binding-B1q9aYT-.d.mts +1947 -0
  285. package/node_modules/rolldown/dist/shared/binding-Dh6LYCIB.mjs +589 -0
  286. package/node_modules/rolldown/dist/shared/bindingify-input-options-CzVhGygm.mjs +2240 -0
  287. package/node_modules/rolldown/dist/shared/constructors-688OwP2q.mjs +65 -0
  288. package/node_modules/rolldown/dist/shared/constructors-awZ1VNvg.d.mts +36 -0
  289. package/node_modules/rolldown/dist/shared/define-config-Demdg3_4.mjs +6 -0
  290. package/node_modules/rolldown/dist/shared/define-config-sxBscJ3M.d.mts +3901 -0
  291. package/node_modules/rolldown/dist/shared/error-B68YLzl3.mjs +85 -0
  292. package/node_modules/rolldown/dist/shared/get-log-filter-BpNVNJ5-.d.mts +35 -0
  293. package/node_modules/rolldown/dist/shared/load-config-BvPPEM7l.mjs +120 -0
  294. package/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts +50 -0
  295. package/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs +180 -0
  296. package/node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs +21 -0
  297. package/node_modules/rolldown/dist/shared/normalize-string-or-regex-BpXHYeN4.mjs +68 -0
  298. package/node_modules/rolldown/dist/shared/parse-CTgsjpo8.mjs +74 -0
  299. package/node_modules/rolldown/dist/shared/prompt-B1Yc1NPt.mjs +847 -0
  300. package/node_modules/rolldown/dist/shared/resolve-tsconfig-BkhP9bkX.mjs +124 -0
  301. package/node_modules/rolldown/dist/shared/rolldown-Brph2NSU.mjs +40 -0
  302. package/node_modules/rolldown/dist/shared/rolldown-build-DR0wzp0V.mjs +3264 -0
  303. package/node_modules/rolldown/dist/shared/transform-CEmFsvJW.d.mts +149 -0
  304. package/node_modules/rolldown/dist/shared/watch-FrHSqg24.mjs +374 -0
  305. package/node_modules/rolldown/dist/utils-index.d.mts +376 -0
  306. package/node_modules/rolldown/dist/utils-index.mjs +2414 -0
  307. package/node_modules/rolldown/package.json +153 -0
  308. package/node_modules/source-map-js/LICENSE +28 -0
  309. package/node_modules/source-map-js/README.md +765 -0
  310. package/node_modules/source-map-js/lib/array-set.js +121 -0
  311. package/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  312. package/node_modules/source-map-js/lib/base64.js +67 -0
  313. package/node_modules/source-map-js/lib/binary-search.js +111 -0
  314. package/node_modules/source-map-js/lib/mapping-list.js +79 -0
  315. package/node_modules/source-map-js/lib/quick-sort.js +132 -0
  316. package/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  317. package/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  318. package/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  319. package/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  320. package/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  321. package/node_modules/source-map-js/lib/source-node.js +413 -0
  322. package/node_modules/source-map-js/lib/util.js +594 -0
  323. package/node_modules/source-map-js/package.json +71 -0
  324. package/node_modules/source-map-js/source-map.d.ts +104 -0
  325. package/node_modules/source-map-js/source-map.js +8 -0
  326. package/node_modules/tinyglobby/LICENSE +21 -0
  327. package/node_modules/tinyglobby/README.md +25 -0
  328. package/node_modules/tinyglobby/dist/index.cjs +335 -0
  329. package/node_modules/tinyglobby/dist/index.d.cts +148 -0
  330. package/node_modules/tinyglobby/dist/index.d.mts +148 -0
  331. package/node_modules/tinyglobby/dist/index.mjs +307 -0
  332. package/node_modules/tinyglobby/package.json +70 -0
  333. package/node_modules/vite/LICENSE.md +2287 -0
  334. package/node_modules/vite/README.md +20 -0
  335. package/node_modules/vite/bin/openChrome.js +68 -0
  336. package/node_modules/vite/bin/vite.js +79 -0
  337. package/node_modules/vite/client.d.ts +285 -0
  338. package/node_modules/vite/dist/client/client.mjs +1269 -0
  339. package/node_modules/vite/dist/client/env.mjs +18 -0
  340. package/node_modules/vite/dist/node/chunks/build.js +5371 -0
  341. package/node_modules/vite/dist/node/chunks/dist.js +6784 -0
  342. package/node_modules/vite/dist/node/chunks/lib.js +371 -0
  343. package/node_modules/vite/dist/node/chunks/logger.js +364 -0
  344. package/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
  345. package/node_modules/vite/dist/node/chunks/node.js +35770 -0
  346. package/node_modules/vite/dist/node/chunks/postcss-import.js +467 -0
  347. package/node_modules/vite/dist/node/cli.js +836 -0
  348. package/node_modules/vite/dist/node/index.d.ts +4010 -0
  349. package/node_modules/vite/dist/node/index.js +3 -0
  350. package/node_modules/vite/dist/node/internal.d.ts +2 -0
  351. package/node_modules/vite/dist/node/internal.js +2 -0
  352. package/node_modules/vite/dist/node/module-runner.d.ts +314 -0
  353. package/node_modules/vite/dist/node/module-runner.js +1274 -0
  354. package/node_modules/vite/misc/false.js +1 -0
  355. package/node_modules/vite/misc/true.js +1 -0
  356. package/node_modules/vite/package.json +194 -0
  357. package/node_modules/vite/types/customEvent.d.ts +79 -0
  358. package/node_modules/vite/types/hmrPayload.d.ts +80 -0
  359. package/node_modules/vite/types/hot.d.ts +39 -0
  360. package/node_modules/vite/types/import-meta.d.ts +5 -0
  361. package/node_modules/vite/types/importGlob.d.ts +131 -0
  362. package/node_modules/vite/types/importMeta.d.ts +30 -0
  363. package/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +44 -0
  364. package/node_modules/vite/types/internal/esbuildOptions.d.ts +28 -0
  365. package/node_modules/vite/types/internal/lightningcssOptions.d.ts +18 -0
  366. package/node_modules/vite/types/internal/rollupTypeCompat.d.ts +24 -0
  367. package/node_modules/vite/types/internal/terserOptions.d.ts +11 -0
  368. package/node_modules/vite/types/metadata.d.ts +47 -0
  369. package/package.json +22 -2
@@ -0,0 +1,4010 @@
1
+ /// <reference types="node" />
2
+ import { t as ModuleRunnerTransport } from "./chunks/moduleRunnerTransport.js";
3
+ import { ConnectedPayload, CustomPayload, CustomPayload as hmrPayload_CustomPayload, ErrorPayload, FullReloadPayload, HMRPayload, HotPayload, HotPayload as hmrPayload_HotPayload, PrunePayload, Update, UpdatePayload } from "#types/hmrPayload";
4
+ import { CustomEventMap, InferCustomEventPayload, InferCustomEventPayload as hmrPayload_InferCustomEventPayload, InvalidatePayload } from "#types/customEvent";
5
+ import * as Rolldown from "rolldown";
6
+ import { CustomPluginOptions, ExistingRawSourceMap, FunctionPluginHooks, ImportKind, InputOption, InputOptions, LoadResult, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleType, ModuleTypeFilter, ObjectHook, OutputBundle, OutputChunk, OutputOptions, PartialResolvedId, PluginContext, PluginContextMeta, ResolveIdResult, RolldownOptions, RolldownOutput, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, TransformPluginContext, VERSION as rolldownVersion, WatcherOptions } from "rolldown";
7
+ import { parseAst as parseAst$1, parseAstAsync as parseAstAsync$1 } from "rolldown/parseAst";
8
+ import * as Rollup from "#types/internal/rollupTypeCompat";
9
+ import { esmExternalRequirePlugin } from "rolldown/plugins";
10
+ import { ESTree, MinifyOptions, MinifyResult, ParseResult, ParserOptions, TransformOptions as rolldown_utils_TransformOptions, TransformResult as rolldown_utils_TransformResult, Visitor, VisitorObject, minify, minifySync, parse, parseSync } from "rolldown/utils";
11
+ import * as http from "node:http";
12
+ import { Agent, ClientRequest, ClientRequestArgs, OutgoingHttpHeaders, ServerResponse } from "node:http";
13
+ import { Http2SecureServer } from "node:http2";
14
+ import * as fs from "node:fs";
15
+ import { EventEmitter } from "node:events";
16
+ import { Server as HttpsServer, ServerOptions as HttpsServerOptions } from "node:https";
17
+ import * as net from "node:net";
18
+ import { Duplex, DuplexOptions, Stream } from "node:stream";
19
+ import { FetchFunction, FetchFunctionOptions, FetchResult, FetchResult as moduleRunner_FetchResult, ModuleEvaluator, ModuleRunner, ModuleRunnerHmr, ModuleRunnerOptions } from "vite/module-runner";
20
+ import { DepsOptimizerEsbuildOptions, EsbuildTarget, EsbuildTransformOptions, EsbuildTransformOptions as esbuildOptions_EsbuildTransformOptions, EsbuildTransformResult } from "#types/internal/esbuildOptions";
21
+ import { SecureContextOptions } from "node:tls";
22
+ import { URL as url_URL } from "node:url";
23
+ import { ZlibOptions } from "node:zlib";
24
+ import { ChunkMetadata, CustomPluginOptionsVite } from "#types/metadata";
25
+ import { Terser, TerserMinifyOptions } from "#types/internal/terserOptions";
26
+ import * as PostCSS from "postcss";
27
+ import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "#types/internal/lightningcssOptions";
28
+ import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "#types/internal/cssPreprocessorOptions";
29
+ import { withFilter } from "rolldown/filter";
30
+ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap, KnownQueryTypeMap } from "#types/importGlob";
31
+
32
+ //#region \0rolldown/runtime.js
33
+ //#endregion
34
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.3.3_typescript@6.0.3_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
35
+ //#region src/node/cli-commands.d.ts
36
+ interface StartOptions {
37
+ root?: string;
38
+ config?: string;
39
+ host: string;
40
+ port?: string | number;
41
+ open?: boolean;
42
+ }
43
+ //#endregion
44
+ //#region ../../node_modules/.pnpm/@vitejs+devtools@0.3.3_typescript@6.0.3_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
45
+ //#region src/node/config.d.ts
46
+ interface DevToolsConfig extends Partial<StartOptions> {
47
+ enabled: boolean;
48
+ /**
49
+ * Vite environments to enable DevTools for. Defaults to all environments.
50
+ */
51
+ environments?: string[];
52
+ /**
53
+ * Disable client authentication.
54
+ *
55
+ * Beware that if you disable client authentication,
56
+ * any browsers can connect to the devtools and access to your server and filesystem.
57
+ * (including other devices, if you open server `host` option to LAN or WAN)
58
+ *
59
+ * @default true
60
+ */
61
+ clientAuth?: boolean;
62
+ /**
63
+ * Pre-configured auth tokens that are automatically trusted.
64
+ *
65
+ * Clients connecting with an auth token matching one of these
66
+ * will be auto-approved without a terminal prompt.
67
+ */
68
+ clientAuthTokens?: string[];
69
+ }
70
+ interface ResolvedDevToolsConfig {
71
+ config: Omit<DevToolsConfig, 'enabled'> & {
72
+ host: string;
73
+ };
74
+ enabled: boolean;
75
+ }
76
+ //#endregion
77
+ //#region src/types/alias.d.ts
78
+ interface Alias {
79
+ find: string | RegExp;
80
+ replacement: string;
81
+ /**
82
+ * Instructs the plugin to use an alternative resolving algorithm,
83
+ * rather than the Rollup's resolver.
84
+ * @default null
85
+ * @deprecated Use a custom plugin with resolveId hook and `enforce: 'pre'` instead
86
+ */
87
+ customResolver?: ResolverFunction | ResolverObject | null;
88
+ }
89
+ type MapToFunction<T> = T extends Function ? T : never;
90
+ type ResolverFunction = MapToFunction<FunctionPluginHooks['resolveId']>;
91
+ interface ResolverObject {
92
+ buildStart?: FunctionPluginHooks['buildStart'];
93
+ resolveId: ResolverFunction;
94
+ }
95
+ /**
96
+ * Specifies an `Object`, or an `Array` of `Object`,
97
+ * which defines aliases used to replace values in `import` or `require` statements.
98
+ * With either format, the order of the entries is important,
99
+ * in that the first defined rules are applied first.
100
+ *
101
+ * This is passed to \@rollup/plugin-alias as the "entries" field
102
+ * https://github.com/rollup/plugins/tree/master/packages/alias#entries
103
+ */
104
+ type AliasOptions = readonly Alias[] | {
105
+ [find: string]: string;
106
+ };
107
+ //#endregion
108
+ //#region src/types/anymatch.d.ts
109
+ type AnymatchFn = (testString: string) => boolean;
110
+ type AnymatchPattern = string | RegExp | AnymatchFn;
111
+ type AnymatchMatcher = AnymatchPattern | AnymatchPattern[];
112
+ //#endregion
113
+ //#region src/types/chokidar.d.ts
114
+ declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
115
+ options: WatchOptions;
116
+ /**
117
+ * Constructs a new FSWatcher instance with optional WatchOptions parameter.
118
+ */
119
+ constructor(options?: WatchOptions);
120
+ /**
121
+ * When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active.
122
+ * Calling watcher.ref() multiple times will have no effect.
123
+ */
124
+ ref(): this;
125
+ /**
126
+ * When called, the active fs.FSWatcher object will not require the Node.js event loop to remain active.
127
+ * If there is no other activity keeping the event loop running, the process may exit before the fs.FSWatcher object's callback is invoked.
128
+ * Calling watcher.unref() multiple times will have no effect.
129
+ */
130
+ unref(): this;
131
+ /**
132
+ * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one
133
+ * string.
134
+ */
135
+ add(paths: string | ReadonlyArray<string>): this;
136
+ /**
137
+ * Stop watching files, directories, or glob patterns. Takes an array of strings or just one
138
+ * string.
139
+ */
140
+ unwatch(paths: string | ReadonlyArray<string>): this;
141
+ /**
142
+ * Returns an object representing all the paths on the file system being watched by this
143
+ * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless
144
+ * the `cwd` option was used), and the values are arrays of the names of the items contained in
145
+ * each directory.
146
+ */
147
+ getWatched(): {
148
+ [directory: string]: string[];
149
+ };
150
+ /**
151
+ * Removes all listeners from watched files.
152
+ */
153
+ close(): Promise<void>;
154
+ on(event: 'add' | 'addDir' | 'change', listener: (path: string, stats?: fs.Stats) => void): this;
155
+ on(event: 'all', listener: (eventName: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void): this;
156
+ /**
157
+ * Error occurred
158
+ */
159
+ on(event: 'error', listener: (error: Error) => void): this;
160
+ /**
161
+ * Exposes the native Node `fs.FSWatcher events`
162
+ */
163
+ on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this;
164
+ /**
165
+ * Fires when the initial scan is complete
166
+ */
167
+ on(event: 'ready', listener: () => void): this;
168
+ on(event: 'unlink' | 'unlinkDir', listener: (path: string) => void): this;
169
+ on(event: string, listener: (...args: any[]) => void): this;
170
+ }
171
+ interface WatchOptions {
172
+ /**
173
+ * Indicates whether the process should continue to run as long as files are being watched. If
174
+ * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
175
+ * even if the process continues to run.
176
+ */
177
+ persistent?: boolean;
178
+ /**
179
+ * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to
180
+ * be ignored. The whole relative or absolute path is tested, not just filename. If a function
181
+ * with two arguments is provided, it gets called twice per path - once with a single argument
182
+ * (the path), second time with two arguments (the path and the
183
+ * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path).
184
+ */
185
+ ignored?: AnymatchMatcher;
186
+ /**
187
+ * If set to `false` then `add`/`addDir` events are also emitted for matching paths while
188
+ * instantiating the watching as chokidar discovers these file paths (before the `ready` event).
189
+ */
190
+ ignoreInitial?: boolean;
191
+ /**
192
+ * When `false`, only the symlinks themselves will be watched for changes instead of following
193
+ * the link references and bubbling events through the link's path.
194
+ */
195
+ followSymlinks?: boolean;
196
+ /**
197
+ * The base directory from which watch `paths` are to be derived. Paths emitted with events will
198
+ * be relative to this.
199
+ */
200
+ cwd?: string;
201
+ /**
202
+ * If set to true then the strings passed to .watch() and .add() are treated as literal path
203
+ * names, even if they look like globs.
204
+ *
205
+ * @default false
206
+ */
207
+ disableGlobbing?: boolean;
208
+ /**
209
+ * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU
210
+ * utilization, consider setting this to `false`. It is typically necessary to **set this to
211
+ * `true` to successfully watch files over a network**, and it may be necessary to successfully
212
+ * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides
213
+ * the `useFsEvents` default.
214
+ */
215
+ usePolling?: boolean;
216
+ /**
217
+ * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly
218
+ * and `fsevents` is available this supersedes the `usePolling` setting. When set to `false` on
219
+ * OS X, `usePolling: true` becomes the default.
220
+ */
221
+ useFsEvents?: boolean;
222
+ /**
223
+ * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that
224
+ * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is
225
+ * provided even in cases where it wasn't already available from the underlying watch events.
226
+ */
227
+ alwaysStat?: boolean;
228
+ /**
229
+ * If set, limits how many levels of subdirectories will be traversed.
230
+ */
231
+ depth?: number;
232
+ /**
233
+ * Interval of file system polling.
234
+ */
235
+ interval?: number;
236
+ /**
237
+ * Interval of file system polling for binary files. ([see list of binary extensions](https://gi
238
+ * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json))
239
+ */
240
+ binaryInterval?: number;
241
+ /**
242
+ * Indicates whether to watch files that don't have read permissions if possible. If watching
243
+ * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed
244
+ * silently.
245
+ */
246
+ ignorePermissionErrors?: boolean;
247
+ /**
248
+ * `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
249
+ * that occur when using editors that use "atomic writes" instead of writing directly to the
250
+ * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
251
+ * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
252
+ * you can override it by setting `atomic` to a custom value, in milliseconds.
253
+ */
254
+ atomic?: boolean | number;
255
+ /**
256
+ * can be set to an object in order to adjust timing params:
257
+ */
258
+ awaitWriteFinish?: AwaitWriteFinishOptions | boolean;
259
+ }
260
+ interface AwaitWriteFinishOptions {
261
+ /**
262
+ * Amount of time in milliseconds for a file size to remain constant before emitting its event.
263
+ */
264
+ stabilityThreshold?: number;
265
+ /**
266
+ * File size polling interval.
267
+ */
268
+ pollInterval?: number;
269
+ }
270
+ //#endregion
271
+ //#region src/types/connect.d.ts
272
+ declare namespace Connect {
273
+ export type ServerHandle = HandleFunction | http.Server;
274
+ export class IncomingMessage extends http.IncomingMessage {
275
+ originalUrl?: http.IncomingMessage['url'] | undefined;
276
+ }
277
+ export type NextFunction = (err?: any) => void;
278
+ export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
279
+ export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
280
+ export type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
281
+ export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
282
+ export interface ServerStackItem {
283
+ route: string;
284
+ handle: ServerHandle;
285
+ }
286
+ export interface Server extends NodeJS.EventEmitter {
287
+ (req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
288
+ route: string;
289
+ stack: ServerStackItem[];
290
+ /**
291
+ * Utilize the given middleware `handle` to the given `route`,
292
+ * defaulting to _/_. This "route" is the mount-point for the
293
+ * middleware, when given a value other than _/_ the middleware
294
+ * is only effective when that segment is present in the request's
295
+ * pathname.
296
+ *
297
+ * For example if we were to mount a function at _/admin_, it would
298
+ * be invoked on _/admin_, and _/admin/settings_, however it would
299
+ * not be invoked for _/_, or _/posts_.
300
+ */
301
+ use(fn: NextHandleFunction): Server;
302
+ use(fn: HandleFunction): Server;
303
+ use(route: string, fn: NextHandleFunction): Server;
304
+ use(route: string, fn: HandleFunction): Server;
305
+ /**
306
+ * Handle server requests, punting them down
307
+ * the middleware stack.
308
+ */
309
+ handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
310
+ /**
311
+ * Listen for connections.
312
+ *
313
+ * This method takes the same arguments
314
+ * as node's `http.Server#listen()`.
315
+ *
316
+ * HTTP and HTTPS:
317
+ *
318
+ * If you run your application both as HTTP
319
+ * and HTTPS you may wrap them individually,
320
+ * since your Connect "server" is really just
321
+ * a JavaScript `Function`.
322
+ *
323
+ * var connect = require('connect')
324
+ * , http = require('http')
325
+ * , https = require('https');
326
+ *
327
+ * var app = connect();
328
+ *
329
+ * http.createServer(app).listen(80);
330
+ * https.createServer(options, app).listen(443);
331
+ */
332
+ listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
333
+ listen(port: number, hostname?: string, callback?: Function): http.Server;
334
+ listen(path: string, callback?: Function): http.Server;
335
+ listen(handle: any, listeningListener?: Function): http.Server;
336
+ }
337
+ }
338
+ //#endregion
339
+ //#region ../../node_modules/.pnpm/http-proxy-3@1.23.3_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/index.d.ts
340
+ interface ProxyTargetDetailed {
341
+ host: string;
342
+ port: number;
343
+ protocol?: string;
344
+ hostname?: string;
345
+ socketPath?: string;
346
+ key?: string;
347
+ passphrase?: string;
348
+ pfx?: Buffer | string;
349
+ cert?: string;
350
+ ca?: string;
351
+ ciphers?: string;
352
+ secureProtocol?: string;
353
+ }
354
+ type ProxyType = "ws" | "web";
355
+ type ProxyTarget = ProxyTargetUrl | ProxyTargetDetailed;
356
+ type ProxyTargetUrl = URL | string | {
357
+ port: number;
358
+ host: string;
359
+ protocol?: string;
360
+ };
361
+ type NormalizeProxyTarget<T extends ProxyTargetUrl> = Exclude<T, string> | URL;
362
+ interface ServerOptions$3 {
363
+ /** URL string to be parsed with the url module. */
364
+ target?: ProxyTarget;
365
+ /** URL string to be parsed with the url module or a URL object. */
366
+ forward?: ProxyTargetUrl;
367
+ /** Object to be passed to http(s).request. */
368
+ agent?: any;
369
+ /** Object to be passed to https.createServer(). */
370
+ ssl?: any;
371
+ /** If you want to proxy websockets. */
372
+ ws?: boolean;
373
+ /** Adds x- forward headers. */
374
+ xfwd?: boolean;
375
+ /** Verify SSL certificate. */
376
+ secure?: boolean;
377
+ /** Explicitly specify if we are proxying to another proxy. */
378
+ toProxy?: boolean;
379
+ /** Specify whether you want to prepend the target's path to the proxy path. */
380
+ prependPath?: boolean;
381
+ /** Specify whether you want to ignore the proxy path of the incoming request. */
382
+ ignorePath?: boolean;
383
+ /** Local interface string to bind for outgoing connections. */
384
+ localAddress?: string;
385
+ /** Changes the origin of the host header to the target URL. */
386
+ changeOrigin?: boolean;
387
+ /** specify whether you want to keep letter case of response header key */
388
+ preserveHeaderKeyCase?: boolean;
389
+ /** Basic authentication i.e. 'user:password' to compute an Authorization header. */
390
+ auth?: string;
391
+ /** Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null. */
392
+ hostRewrite?: string;
393
+ /** Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false. */
394
+ autoRewrite?: boolean;
395
+ /** Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null. */
396
+ protocolRewrite?: string;
397
+ /** rewrites domain of set-cookie headers. */
398
+ cookieDomainRewrite?: false | string | {
399
+ [oldDomain: string]: string;
400
+ };
401
+ /** rewrites path of set-cookie headers. Default: false */
402
+ cookiePathRewrite?: false | string | {
403
+ [oldPath: string]: string;
404
+ };
405
+ /** object with extra headers to be added to target requests. */
406
+ headers?: {
407
+ [header: string]: string | string[] | undefined;
408
+ };
409
+ /** Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes) */
410
+ proxyTimeout?: number;
411
+ /** Timeout (in milliseconds) for incoming requests */
412
+ timeout?: number;
413
+ /** Specify whether you want to follow redirects. Default: false */
414
+ followRedirects?: boolean;
415
+ /** If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event */
416
+ selfHandleResponse?: boolean;
417
+ /** Buffer */
418
+ buffer?: Stream;
419
+ /** Explicitly set the method type of the ProxyReq */
420
+ method?: string;
421
+ /**
422
+ * Optionally override the trusted CA certificates.
423
+ * This is passed to https.request.
424
+ */
425
+ ca?: string;
426
+ /** Optional fetch implementation to use instead of global fetch, use this to activate fetch-based proxying,
427
+ * for example to proxy HTTP/2 requests
428
+ */
429
+ fetch?: typeof fetch;
430
+ /** Optional configuration object for fetch-based proxy requests.
431
+ * Use this to customize fetch request and response handling.
432
+ * For custom fetch implementations, use the `fetch` property.*/
433
+ fetchOptions?: FetchOptions;
434
+ }
435
+ interface FetchOptions {
436
+ /** Fetch request options */
437
+ requestOptions?: RequestInit;
438
+ /** Called before making the fetch request */
439
+ onBeforeRequest?: (requestOptions: RequestInit, req: http.IncomingMessage, res: http.ServerResponse, options: NormalizedServerOptions) => void | Promise<void>;
440
+ /** Called after receiving the fetch response */
441
+ onAfterResponse?: (response: Response, req: http.IncomingMessage, res: http.ServerResponse, options: NormalizedServerOptions) => void | Promise<void>;
442
+ }
443
+ interface NormalizedServerOptions extends ServerOptions$3 {
444
+ target?: NormalizeProxyTarget<ProxyTarget>;
445
+ forward?: NormalizeProxyTarget<ProxyTargetUrl>;
446
+ }
447
+ type ErrorCallback<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = (err: TError, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse> | net.Socket, target?: ProxyTargetUrl) => void;
448
+ type ProxyServerEventMap<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
449
+ error: Parameters<ErrorCallback<TIncomingMessage, TServerResponse, TError>>;
450
+ start: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, target: ProxyTargetUrl];
451
+ open: [socket: net.Socket];
452
+ proxyReq: [proxyReq: http.ClientRequest, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, options: ServerOptions$3, socket: net.Socket];
453
+ proxyRes: [proxyRes: InstanceType<TIncomingMessage>, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>];
454
+ proxyReqWs: [proxyReq: http.ClientRequest, req: InstanceType<TIncomingMessage>, socket: net.Socket, options: ServerOptions$3, head: any];
455
+ econnreset: [err: Error, req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, target: ProxyTargetUrl];
456
+ end: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, proxyRes: InstanceType<TIncomingMessage>];
457
+ close: [proxyRes: InstanceType<TIncomingMessage>, proxySocket: net.Socket, proxyHead: any];
458
+ };
459
+ type ProxyMethodArgs<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
460
+ ws: [req: InstanceType<TIncomingMessage>, socket: any, head: any, ...args: [options?: ServerOptions$3, callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>] | [callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>]];
461
+ web: [req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, ...args: [options: ServerOptions$3, callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>] | [callback?: ErrorCallback<TIncomingMessage, TServerResponse, TError>]];
462
+ };
463
+ type PassFunctions<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> = {
464
+ ws: (req: InstanceType<TIncomingMessage>, socket: net.Socket, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer<TIncomingMessage, TServerResponse, TError>, cb?: ErrorCallback<TIncomingMessage, TServerResponse, TError>) => unknown;
465
+ web: (req: InstanceType<TIncomingMessage>, res: InstanceType<TServerResponse>, options: NormalizedServerOptions, head: Buffer | undefined, server: ProxyServer<TIncomingMessage, TServerResponse, TError>, cb?: ErrorCallback<TIncomingMessage, TServerResponse, TError>) => unknown;
466
+ };
467
+ declare class ProxyServer<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error> extends EventEmitter<ProxyServerEventMap<TIncomingMessage, TServerResponse, TError>> {
468
+ /**
469
+ * Used for proxying WS(S) requests
470
+ * @param req - Client request.
471
+ * @param socket - Client socket.
472
+ * @param head - Client head.
473
+ * @param options - Additional options.
474
+ */
475
+ readonly ws: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["ws"]) => void;
476
+ /**
477
+ * Used for proxying regular HTTP(S) requests
478
+ * @param req - Client request.
479
+ * @param res - Client response.
480
+ * @param options - Additional options.
481
+ */
482
+ readonly web: (...args: ProxyMethodArgs<TIncomingMessage, TServerResponse, TError>["web"]) => void;
483
+ private options;
484
+ private webPasses;
485
+ private wsPasses;
486
+ private _server?;
487
+ /**
488
+ * Creates the proxy server with specified options.
489
+ * @param options - Config object passed to the proxy
490
+ */
491
+ constructor(options?: ServerOptions$3);
492
+ /**
493
+ * Creates the proxy server with specified options.
494
+ * @param options Config object passed to the proxy
495
+ * @returns Proxy object with handlers for `ws` and `web` requests
496
+ */
497
+ static createProxyServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
498
+ /**
499
+ * Creates the proxy server with specified options.
500
+ * @param options Config object passed to the proxy
501
+ * @returns Proxy object with handlers for `ws` and `web` requests
502
+ */
503
+ static createServer<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
504
+ /**
505
+ * Creates the proxy server with specified options.
506
+ * @param options Config object passed to the proxy
507
+ * @returns Proxy object with handlers for `ws` and `web` requests
508
+ */
509
+ static createProxy<TIncomingMessage extends typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
510
+ createRightProxy: <PT extends ProxyType>(type: PT) => Function;
511
+ onError: (err: TError) => void;
512
+ /**
513
+ * A function that wraps the object in a webserver, for your convenience
514
+ * @param port - Port to listen on
515
+ * @param hostname - The hostname to listen on
516
+ */
517
+ listen: (port: number, hostname?: string) => this;
518
+ address: () => string | net.AddressInfo | null | undefined;
519
+ /**
520
+ * A function that closes the inner webserver and stops listening on given port
521
+ */
522
+ close: (cb?: Function) => void;
523
+ before: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
524
+ after: <PT extends ProxyType>(type: PT, passName: string, cb: PassFunctions<TIncomingMessage, TServerResponse, TError>[PT]) => void;
525
+ }
526
+ //#endregion
527
+ //#region ../../node_modules/.pnpm/http-proxy-3@1.23.3_ms@2.1.3/node_modules/http-proxy-3/dist/lib/http-proxy/passes/ws-incoming.d.ts
528
+ declare function numOpenSockets(): number;
529
+ declare namespace index_d_exports {
530
+ export { ErrorCallback, ProxyServer, ProxyTarget, ProxyTargetUrl, ServerOptions$3 as ServerOptions, createProxyServer as createProxy, createProxyServer, createProxyServer as createServer, ProxyServer as default, numOpenSockets };
531
+ }
532
+ /**
533
+ * Creates the proxy server.
534
+ *
535
+ * Examples:
536
+ *
537
+ * httpProxy.createProxyServer({ .. }, 8000)
538
+ * // => '{ web: [Function], ws: [Function] ... }'
539
+ *
540
+ * @param {Object} Options Config object passed to the proxy
541
+ *
542
+ * @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests
543
+ *
544
+ * @api public
545
+ */
546
+ declare function createProxyServer<TIncomingMessage extends typeof http.IncomingMessage = typeof http.IncomingMessage, TServerResponse extends typeof http.ServerResponse = typeof http.ServerResponse, TError = Error>(options?: ServerOptions$3): ProxyServer<TIncomingMessage, TServerResponse, TError>;
547
+ //#endregion
548
+ //#region src/node/server/middlewares/proxy.d.ts
549
+ interface ProxyOptions extends ServerOptions$3 {
550
+ /**
551
+ * rewrite path
552
+ */
553
+ rewrite?: (path: string) => string;
554
+ /**
555
+ * configure the proxy server (e.g. listen to events)
556
+ */
557
+ configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
558
+ /**
559
+ * webpack-dev-server style bypass function
560
+ */
561
+ bypass?: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
562
+ /**
563
+ * rewrite the Origin header of a WebSocket request to match the target
564
+ *
565
+ * **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
566
+ */
567
+ rewriteWsOrigin?: boolean | undefined;
568
+ }
569
+ //#endregion
570
+ //#region src/node/logger.d.ts
571
+ type LogType = "error" | "warn" | "info";
572
+ type LogLevel = LogType | "silent";
573
+ interface Logger {
574
+ info(msg: string, options?: LogOptions): void;
575
+ warn(msg: string, options?: LogOptions): void;
576
+ warnOnce(msg: string, options?: LogOptions): void;
577
+ error(msg: string, options?: LogErrorOptions): void;
578
+ clearScreen(type: LogType): void;
579
+ hasErrorLogged(error: Error | RollupError): boolean;
580
+ hasWarned: boolean;
581
+ }
582
+ interface LogOptions {
583
+ clear?: boolean;
584
+ timestamp?: boolean;
585
+ environment?: string;
586
+ }
587
+ interface LogErrorOptions extends LogOptions {
588
+ error?: Error | RollupError | null;
589
+ }
590
+ interface LoggerOptions {
591
+ prefix?: string;
592
+ allowClearScreen?: boolean;
593
+ customLogger?: Logger;
594
+ console?: Console;
595
+ }
596
+ declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
597
+ //#endregion
598
+ //#region src/node/http.d.ts
599
+ interface CommonServerOptions {
600
+ /**
601
+ * Specify server port. Note if the port is already being used, Vite will
602
+ * automatically try the next available port so this may not be the actual
603
+ * port the server ends up listening on.
604
+ */
605
+ port?: number;
606
+ /**
607
+ * If enabled, vite will exit if specified port is already in use
608
+ */
609
+ strictPort?: boolean;
610
+ /**
611
+ * Specify which IP addresses the server should listen on.
612
+ * Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
613
+ */
614
+ host?: string | boolean;
615
+ /**
616
+ * The hostnames that Vite is allowed to respond to.
617
+ * `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
618
+ * When using HTTPS, this check is skipped.
619
+ *
620
+ * If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
621
+ * For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
622
+ *
623
+ * If set to `true`, the server is allowed to respond to requests for any hosts.
624
+ * This is not recommended as it will be vulnerable to DNS rebinding attacks.
625
+ */
626
+ allowedHosts?: string[] | true;
627
+ /**
628
+ * Enable TLS + HTTP/2.
629
+ * Note: this downgrades to TLS only when the proxy option is also used.
630
+ */
631
+ https?: HttpsServerOptions;
632
+ /**
633
+ * Open browser window on startup
634
+ */
635
+ open?: boolean | string;
636
+ /**
637
+ * Configure custom proxy rules for the dev server. Expects an object
638
+ * of `{ key: options }` pairs.
639
+ * Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
640
+ * Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
641
+ *
642
+ * Example `vite.config.js`:
643
+ * ``` js
644
+ * module.exports = {
645
+ * proxy: {
646
+ * // string shorthand: /foo -> http://localhost:4567/foo
647
+ * '/foo': 'http://localhost:4567',
648
+ * // with options
649
+ * '/api': {
650
+ * target: 'http://jsonplaceholder.typicode.com',
651
+ * changeOrigin: true,
652
+ * rewrite: path => path.replace(/^\/api/, '')
653
+ * }
654
+ * }
655
+ * }
656
+ * ```
657
+ */
658
+ proxy?: Record<string, string | ProxyOptions>;
659
+ /**
660
+ * Configure CORS for the dev server.
661
+ * Uses https://github.com/expressjs/cors.
662
+ *
663
+ * When enabling this option, **we recommend setting a specific value
664
+ * rather than `true`** to avoid exposing the source code to untrusted origins.
665
+ *
666
+ * Set to `true` to allow all methods from any origin, or configure separately
667
+ * using an object.
668
+ *
669
+ * @default false
670
+ */
671
+ cors?: CorsOptions | boolean;
672
+ /**
673
+ * Specify server response headers.
674
+ */
675
+ headers?: OutgoingHttpHeaders;
676
+ }
677
+ /**
678
+ * https://github.com/expressjs/cors#configuration-options
679
+ */
680
+ interface CorsOptions {
681
+ /**
682
+ * Configures the Access-Control-Allow-Origin CORS header.
683
+ *
684
+ * **We recommend setting a specific value rather than
685
+ * `true`** to avoid exposing the source code to untrusted origins.
686
+ */
687
+ origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
688
+ methods?: string | string[];
689
+ allowedHeaders?: string | string[];
690
+ exposedHeaders?: string | string[];
691
+ credentials?: boolean;
692
+ maxAge?: number;
693
+ preflightContinue?: boolean;
694
+ optionsSuccessStatus?: number;
695
+ }
696
+ type CorsOrigin = boolean | string | RegExp | (string | RegExp)[];
697
+ //#endregion
698
+ //#region src/shared/forwardConsole.d.ts
699
+ type ForwardConsoleLogLevel = "error" | "warn" | "info" | "log" | "debug" | (string & {});
700
+ interface ForwardConsoleOptions {
701
+ unhandledErrors?: boolean;
702
+ logLevels?: ForwardConsoleLogLevel[];
703
+ }
704
+ interface ResolvedForwardConsoleOptions {
705
+ enabled: boolean;
706
+ unhandledErrors: boolean;
707
+ logLevels: ForwardConsoleLogLevel[];
708
+ }
709
+ //#endregion
710
+ //#region src/node/typeUtils.d.ts
711
+ type RequiredExceptFor<T, K extends keyof T> = Pick<T, K> & Required<Omit<T, K>>;
712
+ //#endregion
713
+ //#region src/node/preview.d.ts
714
+ interface PreviewOptions extends CommonServerOptions {}
715
+ interface ResolvedPreviewOptions extends RequiredExceptFor<PreviewOptions, "host" | "https" | "proxy"> {}
716
+ interface PreviewServer {
717
+ /**
718
+ * The resolved vite config object
719
+ */
720
+ config: ResolvedConfig;
721
+ /**
722
+ * Stop the server.
723
+ */
724
+ close(): Promise<void>;
725
+ /**
726
+ * A connect app instance.
727
+ * - Can be used to attach custom middlewares to the preview server.
728
+ * - Can also be used as the handler function of a custom http server
729
+ * or as a middleware in any connect-style Node.js frameworks
730
+ *
731
+ * https://github.com/senchalabs/connect#use-middleware
732
+ */
733
+ middlewares: Connect.Server;
734
+ /**
735
+ * native Node http server instance
736
+ */
737
+ httpServer: HttpServer;
738
+ /**
739
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
740
+ * if the server is not listening on any port.
741
+ */
742
+ resolvedUrls: ResolvedServerUrls | null;
743
+ /**
744
+ * Print server urls
745
+ */
746
+ printUrls(): void;
747
+ /**
748
+ * Bind CLI shortcuts
749
+ */
750
+ bindCLIShortcuts(options?: BindCLIShortcutsOptions<PreviewServer>): void;
751
+ }
752
+ type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>;
753
+ /**
754
+ * Starts the Vite server in preview mode, to simulate a production deployment
755
+ */
756
+ declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
757
+ //#endregion
758
+ //#region src/node/shortcuts.d.ts
759
+ type BindCLIShortcutsOptions<Server = ViteDevServer | PreviewServer> = {
760
+ /**
761
+ * Print a one-line shortcuts "help" hint to the terminal
762
+ */
763
+ print?: boolean;
764
+ /**
765
+ * Custom shortcuts to run when a key is pressed. These shortcuts take priority
766
+ * over the default shortcuts if they have the same keys (except the `h` key).
767
+ * To disable a default shortcut, define the same key but with `action: undefined`.
768
+ */
769
+ customShortcuts?: CLIShortcut<Server>[];
770
+ };
771
+ type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
772
+ key: string;
773
+ description: string;
774
+ action?(server: Server): void | Promise<void>;
775
+ };
776
+ //#endregion
777
+ //#region src/node/baseEnvironment.d.ts
778
+ declare class PartialEnvironment {
779
+ name: string;
780
+ getTopLevelConfig(): ResolvedConfig;
781
+ config: ResolvedConfig & ResolvedEnvironmentOptions;
782
+ logger: Logger;
783
+ constructor(name: string, topLevelConfig: ResolvedConfig, options?: ResolvedEnvironmentOptions);
784
+ }
785
+ declare class BaseEnvironment extends PartialEnvironment {
786
+ get plugins(): readonly Plugin[];
787
+ constructor(name: string, config: ResolvedConfig, options?: ResolvedEnvironmentOptions);
788
+ }
789
+ /**
790
+ * This class discourages users from inversely checking the `mode`
791
+ * to determine the type of environment, e.g.
792
+ *
793
+ * ```js
794
+ * const isDev = environment.mode !== 'build' // bad
795
+ * const isDev = environment.mode === 'dev' // good
796
+ * ```
797
+ *
798
+ * You should also not check against `"unknown"` specifically. It's
799
+ * a placeholder for more possible environment types.
800
+ */
801
+ declare class UnknownEnvironment extends BaseEnvironment {
802
+ mode: "unknown";
803
+ }
804
+ //#endregion
805
+ //#region src/node/optimizer/scan.d.ts
806
+ declare class ScanEnvironment extends BaseEnvironment {
807
+ mode: "scan";
808
+ get pluginContainer(): EnvironmentPluginContainer;
809
+ init(): Promise<void>;
810
+ }
811
+ //#endregion
812
+ //#region src/node/optimizer/index.d.ts
813
+ type ExportsData = {
814
+ hasModuleSyntax: boolean;
815
+ exports: readonly string[];
816
+ jsxLoader?: boolean;
817
+ };
818
+ interface DepsOptimizer {
819
+ init: () => Promise<void>;
820
+ metadata: DepOptimizationMetadata;
821
+ scanProcessing?: Promise<void>;
822
+ registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
823
+ run: () => void;
824
+ isOptimizedDepFile: (id: string) => boolean;
825
+ isOptimizedDepUrl: (url: string) => boolean;
826
+ getOptimizedDepId: (depInfo: OptimizedDepInfo) => string;
827
+ close: () => Promise<void>;
828
+ options: DepOptimizationOptions;
829
+ }
830
+ interface DepOptimizationConfig {
831
+ /**
832
+ * Force optimize listed dependencies (must be resolvable import paths,
833
+ * cannot be globs).
834
+ */
835
+ include?: string[];
836
+ /**
837
+ * Do not optimize these dependencies (must be resolvable import paths,
838
+ * cannot be globs).
839
+ */
840
+ exclude?: string[];
841
+ /**
842
+ * Forces ESM interop when importing these dependencies. Some legacy
843
+ * packages advertise themselves as ESM but use `require` internally
844
+ * @experimental
845
+ */
846
+ needsInterop?: string[];
847
+ /**
848
+ * Options to pass to esbuild during the dep scanning and optimization
849
+ *
850
+ * Certain options are omitted since changing them would not be compatible
851
+ * with Vite's dep optimization.
852
+ *
853
+ * - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
854
+ * - `plugins` are merged with Vite's dep plugin
855
+ *
856
+ * https://esbuild.github.io/api
857
+ *
858
+ * @deprecated Use `rolldownOptions` instead.
859
+ */
860
+ esbuildOptions?: DepsOptimizerEsbuildOptions;
861
+ /**
862
+ * @deprecated Use `rolldownOptions` instead.
863
+ */
864
+ rollupOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
865
+ output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
866
+ };
867
+ /**
868
+ * Options to pass to rolldown during the dep scanning and optimization
869
+ *
870
+ * Certain options are omitted since changing them would not be compatible
871
+ * with Vite's dep optimization.
872
+ *
873
+ * - `plugins` are merged with Vite's dep plugin
874
+ */
875
+ rolldownOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
876
+ output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
877
+ };
878
+ /**
879
+ * List of file extensions that can be optimized. A corresponding esbuild
880
+ * plugin must exist to handle the specific extension.
881
+ *
882
+ * By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
883
+ * allows specifying additional extensions.
884
+ *
885
+ * @experimental
886
+ */
887
+ extensions?: string[];
888
+ /**
889
+ * Deps optimization during build was removed in Vite 5.1. This option is
890
+ * now redundant and will be removed in a future version. Switch to using
891
+ * `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
892
+ * true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
893
+ * @default 'build'
894
+ * @deprecated
895
+ * @experimental
896
+ */
897
+ disabled?: boolean | "build" | "dev";
898
+ /**
899
+ * Automatic dependency discovery. When `noDiscovery` is true, only dependencies
900
+ * listed in `include` will be optimized. The scanner isn't run for cold start
901
+ * in this case. CJS-only dependencies must be present in `include` during dev.
902
+ * @default false
903
+ */
904
+ noDiscovery?: boolean;
905
+ /**
906
+ * When enabled, it will hold the first optimized deps results until all static
907
+ * imports are crawled on cold start. This avoids the need for full-page reloads
908
+ * when new dependencies are discovered and they trigger the generation of new
909
+ * common chunks. If all dependencies are found by the scanner plus the explicitly
910
+ * defined ones in `include`, it is better to disable this option to let the
911
+ * browser process more requests in parallel.
912
+ * @default true
913
+ * @experimental
914
+ */
915
+ holdUntilCrawlEnd?: boolean;
916
+ /**
917
+ * When enabled, Vite will not throw an error when an outdated optimized
918
+ * dependency is requested. Enabling this option may cause a single module
919
+ * to have a multiple reference.
920
+ * @default false
921
+ * @experimental
922
+ */
923
+ ignoreOutdatedRequests?: boolean;
924
+ }
925
+ type DepOptimizationOptions = DepOptimizationConfig & {
926
+ /**
927
+ * By default, Vite will crawl your `index.html` to detect dependencies that
928
+ * need to be pre-bundled. If `build.rolldownOptions.input` is specified, Vite
929
+ * will crawl those entry points instead.
930
+ *
931
+ * If neither of these fit your needs, you can specify custom entries using
932
+ * this option - the value should be a tinyglobby pattern or array of patterns
933
+ * (https://github.com/SuperchupuDev/tinyglobby) that are relative from
934
+ * vite project root. This will overwrite default entries inference.
935
+ */
936
+ entries?: string | string[];
937
+ /**
938
+ * Force dep pre-optimization regardless of whether deps have changed.
939
+ * @experimental
940
+ */
941
+ force?: boolean;
942
+ };
943
+ interface OptimizedDepInfo {
944
+ id: string;
945
+ file: string;
946
+ src?: string;
947
+ needsInterop?: boolean;
948
+ browserHash?: string;
949
+ fileHash?: string;
950
+ /**
951
+ * During optimization, ids can still be resolved to their final location
952
+ * but the bundles may not yet be saved to disk
953
+ */
954
+ processing?: Promise<void>;
955
+ /**
956
+ * ExportData cache, discovered deps will parse the src entry to get exports
957
+ * data used both to define if interop is needed and when pre-bundling
958
+ */
959
+ exportsData?: Promise<ExportsData>;
960
+ isDynamicEntry?: boolean;
961
+ }
962
+ interface DepOptimizationMetadata {
963
+ /**
964
+ * The main hash is determined by user config and dependency lockfiles.
965
+ * This is checked on server startup to avoid unnecessary re-bundles.
966
+ */
967
+ hash: string;
968
+ /**
969
+ * This hash is determined by dependency lockfiles.
970
+ * This is checked on server startup to avoid unnecessary re-bundles.
971
+ */
972
+ lockfileHash: string;
973
+ /**
974
+ * This hash is determined by user config.
975
+ * This is checked on server startup to avoid unnecessary re-bundles.
976
+ */
977
+ configHash: string;
978
+ /**
979
+ * The browser hash is determined by the main hash plus additional dependencies
980
+ * discovered at runtime. This is used to invalidate browser requests to
981
+ * optimized deps.
982
+ */
983
+ browserHash: string;
984
+ /**
985
+ * Metadata for each already optimized dependency
986
+ */
987
+ optimized: Record<string, OptimizedDepInfo>;
988
+ /**
989
+ * Metadata for non-entry optimized chunks and dynamic imports
990
+ */
991
+ chunks: Record<string, OptimizedDepInfo>;
992
+ /**
993
+ * Metadata for each newly discovered dependency after processing
994
+ */
995
+ discovered: Record<string, OptimizedDepInfo>;
996
+ /**
997
+ * OptimizedDepInfo list
998
+ */
999
+ depInfoList: OptimizedDepInfo[];
1000
+ }
1001
+ /**
1002
+ * Scan and optimize dependencies within a project.
1003
+ * Used by Vite CLI when running `vite optimize`.
1004
+ *
1005
+ * @deprecated the optimization process runs automatically and does not need to be called
1006
+ */
1007
+ declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean): Promise<DepOptimizationMetadata>;
1008
+ //#endregion
1009
+ //#region src/node/server/transformRequest.d.ts
1010
+ interface TransformResult {
1011
+ code: string;
1012
+ map: SourceMap | {
1013
+ mappings: "";
1014
+ } | null;
1015
+ ssr?: boolean;
1016
+ etag?: string;
1017
+ deps?: string[];
1018
+ dynamicDeps?: string[];
1019
+ }
1020
+ interface TransformOptions {
1021
+ /**
1022
+ * @deprecated inferred from environment
1023
+ */
1024
+ ssr?: boolean;
1025
+ }
1026
+ //#endregion
1027
+ //#region src/node/server/moduleGraph.d.ts
1028
+ declare class EnvironmentModuleNode {
1029
+ environment: string;
1030
+ /**
1031
+ * Public served url path, starts with /
1032
+ */
1033
+ url: string;
1034
+ /**
1035
+ * Resolved file system path + query
1036
+ */
1037
+ id: string | null;
1038
+ file: string | null;
1039
+ type: "js" | "css" | "asset";
1040
+ info?: ModuleInfo;
1041
+ meta?: Record<string, any>;
1042
+ importers: Set<EnvironmentModuleNode>;
1043
+ importedModules: Set<EnvironmentModuleNode>;
1044
+ acceptedHmrDeps: Set<EnvironmentModuleNode>;
1045
+ acceptedHmrExports: Set<string> | null;
1046
+ importedBindings: Map<string, Set<string>> | null;
1047
+ isSelfAccepting?: boolean;
1048
+ transformResult: TransformResult | null;
1049
+ ssrModule: Record<string, any> | null;
1050
+ ssrError: Error | null;
1051
+ lastHMRTimestamp: number;
1052
+ lastInvalidationTimestamp: number;
1053
+ /**
1054
+ * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
1055
+ */
1056
+ constructor(url: string, environment: string, setIsSelfAccepting?: boolean);
1057
+ }
1058
+ type ResolvedUrl = [url: string, resolvedId: string, meta: object | null | undefined];
1059
+ declare class EnvironmentModuleGraph {
1060
+ environment: string;
1061
+ urlToModuleMap: Map<string, EnvironmentModuleNode>;
1062
+ idToModuleMap: Map<string, EnvironmentModuleNode>;
1063
+ etagToModuleMap: Map<string, EnvironmentModuleNode>;
1064
+ fileToModulesMap: Map<string, Set<EnvironmentModuleNode>>;
1065
+ constructor(environment: string, resolveId: (url: string) => Promise<PartialResolvedId | null>);
1066
+ getModuleByUrl(rawUrl: string): Promise<EnvironmentModuleNode | undefined>;
1067
+ getModuleById(id: string): EnvironmentModuleNode | undefined;
1068
+ getModulesByFile(file: string): Set<EnvironmentModuleNode> | undefined;
1069
+ onFileChange(file: string): void;
1070
+ onFileDelete(file: string): void;
1071
+ invalidateModule(mod: EnvironmentModuleNode, seen?: Set<EnvironmentModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1072
+ invalidateAll(): void;
1073
+ /**
1074
+ * Update the module graph based on a module's updated imports information
1075
+ * If there are dependencies that no longer have any importers, they are
1076
+ * returned as a Set.
1077
+ *
1078
+ * @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
1079
+ * This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
1080
+ */
1081
+ updateModuleInfo(mod: EnvironmentModuleNode, importedModules: Set<string | EnvironmentModuleNode>, importedBindings: Map<string, Set<string>> | null, acceptedModules: Set<string | EnvironmentModuleNode>, acceptedExports: Set<string> | null, isSelfAccepting: boolean, staticImportedUrls?: Set<string>): Promise<Set<EnvironmentModuleNode> | undefined>;
1082
+ ensureEntryFromUrl(rawUrl: string, setIsSelfAccepting?: boolean): Promise<EnvironmentModuleNode>;
1083
+ createFileOnlyEntry(file: string): EnvironmentModuleNode;
1084
+ resolveUrl(url: string): Promise<ResolvedUrl>;
1085
+ updateModuleTransformResult(mod: EnvironmentModuleNode, result: TransformResult | null): void;
1086
+ getModuleByEtag(etag: string): EnvironmentModuleNode | undefined;
1087
+ }
1088
+ //#endregion
1089
+ //#region src/node/server/mixedModuleGraph.d.ts
1090
+ declare class ModuleNode {
1091
+ _moduleGraph: ModuleGraph;
1092
+ _clientModule: EnvironmentModuleNode | undefined;
1093
+ _ssrModule: EnvironmentModuleNode | undefined;
1094
+ constructor(moduleGraph: ModuleGraph, clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode);
1095
+ _get<T extends keyof EnvironmentModuleNode>(prop: T): EnvironmentModuleNode[T];
1096
+ _set<T extends keyof EnvironmentModuleNode>(prop: T, value: EnvironmentModuleNode[T]): void;
1097
+ _wrapModuleSet(prop: ModuleSetNames, module: EnvironmentModuleNode | undefined): Set<ModuleNode>;
1098
+ _getModuleSetUnion(prop: "importedModules" | "importers"): Set<ModuleNode>;
1099
+ _getModuleInfoUnion(prop: "info"): ModuleInfo | undefined;
1100
+ _getModuleObjectUnion(prop: "meta"): Record<string, any> | undefined;
1101
+ get url(): string;
1102
+ set url(value: string);
1103
+ get id(): string | null;
1104
+ set id(value: string | null);
1105
+ get file(): string | null;
1106
+ set file(value: string | null);
1107
+ get type(): "js" | "css" | "asset";
1108
+ get info(): ModuleInfo | undefined;
1109
+ get meta(): Record<string, any> | undefined;
1110
+ get importers(): Set<ModuleNode>;
1111
+ get clientImportedModules(): Set<ModuleNode>;
1112
+ get ssrImportedModules(): Set<ModuleNode>;
1113
+ get importedModules(): Set<ModuleNode>;
1114
+ get acceptedHmrDeps(): Set<ModuleNode>;
1115
+ get acceptedHmrExports(): Set<string> | null;
1116
+ get importedBindings(): Map<string, Set<string>> | null;
1117
+ get isSelfAccepting(): boolean | undefined;
1118
+ get transformResult(): TransformResult | null;
1119
+ set transformResult(value: TransformResult | null);
1120
+ get ssrTransformResult(): TransformResult | null;
1121
+ set ssrTransformResult(value: TransformResult | null);
1122
+ get ssrModule(): Record<string, any> | null;
1123
+ get ssrError(): Error | null;
1124
+ get lastHMRTimestamp(): number;
1125
+ set lastHMRTimestamp(value: number);
1126
+ get lastInvalidationTimestamp(): number;
1127
+ get invalidationState(): TransformResult | "HARD_INVALIDATED" | undefined;
1128
+ get ssrInvalidationState(): TransformResult | "HARD_INVALIDATED" | undefined;
1129
+ }
1130
+ declare class ModuleGraph {
1131
+ urlToModuleMap: Map<string, ModuleNode>;
1132
+ idToModuleMap: Map<string, ModuleNode>;
1133
+ etagToModuleMap: Map<string, ModuleNode>;
1134
+ fileToModulesMap: Map<string, Set<ModuleNode>>;
1135
+ private moduleNodeCache;
1136
+ constructor(moduleGraphs: {
1137
+ client: () => EnvironmentModuleGraph;
1138
+ ssr: () => EnvironmentModuleGraph;
1139
+ });
1140
+ getModuleById(id: string): ModuleNode | undefined;
1141
+ getModuleByUrl(url: string, _ssr?: boolean): Promise<ModuleNode | undefined>;
1142
+ getModulesByFile(file: string): Set<ModuleNode> | undefined;
1143
+ onFileChange(file: string): void;
1144
+ onFileDelete(file: string): void;
1145
+ invalidateModule(mod: ModuleNode, seen?: Set<ModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
1146
+ invalidateAll(): void;
1147
+ ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
1148
+ createFileOnlyEntry(file: string): ModuleNode;
1149
+ resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
1150
+ updateModuleTransformResult(mod: ModuleNode, result: TransformResult | null, ssr?: boolean): void;
1151
+ getModuleByEtag(etag: string): ModuleNode | undefined;
1152
+ getBackwardCompatibleBrowserModuleNode(clientModule: EnvironmentModuleNode): ModuleNode;
1153
+ getBackwardCompatibleServerModuleNode(ssrModule: EnvironmentModuleNode): ModuleNode;
1154
+ getBackwardCompatibleModuleNode(mod: EnvironmentModuleNode): ModuleNode;
1155
+ getBackwardCompatibleModuleNodeDual(clientModule?: EnvironmentModuleNode, ssrModule?: EnvironmentModuleNode): ModuleNode;
1156
+ }
1157
+ type ModuleSetNames = "acceptedHmrDeps" | "importedModules";
1158
+ //#endregion
1159
+ //#region src/node/server/hmr.d.ts
1160
+ interface WsOptions {
1161
+ protocol?: string;
1162
+ host?: string;
1163
+ port?: number;
1164
+ clientPort?: number;
1165
+ path?: string;
1166
+ timeout?: number;
1167
+ server?: HttpServer;
1168
+ }
1169
+ interface HmrOptions {
1170
+ /**
1171
+ * @deprecated Use `server.ws.protocol` instead.
1172
+ */
1173
+ protocol?: string;
1174
+ /**
1175
+ * @deprecated Use `server.ws.host` instead.
1176
+ */
1177
+ host?: string;
1178
+ /**
1179
+ * @deprecated Use `server.ws.port` instead.
1180
+ */
1181
+ port?: number;
1182
+ /**
1183
+ * @deprecated Use `server.ws.clientPort` instead.
1184
+ */
1185
+ clientPort?: number;
1186
+ /**
1187
+ * @deprecated Use `server.ws.path` instead.
1188
+ */
1189
+ path?: string;
1190
+ /**
1191
+ * @deprecated Use `server.ws.timeout` instead.
1192
+ */
1193
+ timeout?: number;
1194
+ overlay?: boolean;
1195
+ /**
1196
+ * @deprecated Use `server.ws.server` instead.
1197
+ */
1198
+ server?: HttpServer;
1199
+ }
1200
+ interface HotUpdateOptions {
1201
+ type: "create" | "update" | "delete";
1202
+ file: string;
1203
+ timestamp: number;
1204
+ modules: Array<EnvironmentModuleNode>;
1205
+ read: () => string | Promise<string>;
1206
+ server: ViteDevServer;
1207
+ }
1208
+ interface HmrContext {
1209
+ file: string;
1210
+ timestamp: number;
1211
+ modules: Array<ModuleNode>;
1212
+ read: () => string | Promise<string>;
1213
+ server: ViteDevServer;
1214
+ }
1215
+ interface HotChannelClient {
1216
+ send(payload: hmrPayload_HotPayload): void;
1217
+ }
1218
+ type HotChannelListener<T extends string = string> = (data: InferCustomEventPayload<T>, client: HotChannelClient) => void;
1219
+ interface HotChannel<Api = any> {
1220
+ /**
1221
+ * When true, the fs access check is skipped in fetchModule.
1222
+ * Set this for transports that is not exposed over the network.
1223
+ */
1224
+ skipFsCheck?: boolean;
1225
+ /**
1226
+ * Broadcast events to all clients
1227
+ */
1228
+ send?(payload: hmrPayload_HotPayload): void;
1229
+ /**
1230
+ * Handle custom event emitted by `import.meta.hot.send`
1231
+ */
1232
+ on?<T extends string>(event: T, listener: HotChannelListener<T>): void;
1233
+ on?(event: "connection", listener: () => void): void;
1234
+ /**
1235
+ * Unregister event listener
1236
+ */
1237
+ off?(event: string, listener: Function): void;
1238
+ /**
1239
+ * Start listening for messages
1240
+ */
1241
+ listen?(): void;
1242
+ /**
1243
+ * Disconnect all clients, called when server is closed or restarted.
1244
+ */
1245
+ close?(): Promise<unknown> | void;
1246
+ api?: Api;
1247
+ }
1248
+ interface NormalizedHotChannelClient {
1249
+ /**
1250
+ * Send event to the client
1251
+ */
1252
+ send(payload: hmrPayload_HotPayload): void;
1253
+ /**
1254
+ * Send custom event
1255
+ */
1256
+ send(event: string, payload?: hmrPayload_CustomPayload["data"]): void;
1257
+ }
1258
+ interface NormalizedHotChannel<Api = any> {
1259
+ /**
1260
+ * Broadcast events to all clients
1261
+ */
1262
+ send(payload: hmrPayload_HotPayload): void;
1263
+ /**
1264
+ * Send custom event
1265
+ */
1266
+ send<T extends string>(event: T, payload?: InferCustomEventPayload<T>): void;
1267
+ /**
1268
+ * Handle custom event emitted by `import.meta.hot.send`
1269
+ */
1270
+ on<T extends string>(event: T, listener: (data: InferCustomEventPayload<T>, client: NormalizedHotChannelClient) => void): void;
1271
+ /**
1272
+ * @deprecated use `vite:client:connect` event instead
1273
+ */
1274
+ on(event: "connection", listener: () => void): void;
1275
+ /**
1276
+ * Unregister event listener
1277
+ */
1278
+ off(event: string, listener: Function): void;
1279
+ handleInvoke(payload: hmrPayload_HotPayload): Promise<{
1280
+ result: any;
1281
+ } | {
1282
+ error: any;
1283
+ }>;
1284
+ /**
1285
+ * Start listening for messages
1286
+ */
1287
+ listen(): void;
1288
+ /**
1289
+ * Disconnect all clients, called when server is closed or restarted.
1290
+ */
1291
+ close(): Promise<unknown> | void;
1292
+ api?: Api;
1293
+ }
1294
+ type ServerHotChannelApi = {
1295
+ innerEmitter: EventEmitter;
1296
+ outsideEmitter: EventEmitter;
1297
+ };
1298
+ type ServerHotChannel = HotChannel<ServerHotChannelApi>;
1299
+ type NormalizedServerHotChannel = NormalizedHotChannel<ServerHotChannelApi>;
1300
+ declare function createServerHotChannel(): ServerHotChannel;
1301
+ //#endregion
1302
+ //#region src/types/ws.d.ts
1303
+ // WebSocket socket.
1304
+ declare class WebSocket extends EventEmitter {
1305
+ /** The connection is not yet open. */
1306
+ static readonly CONNECTING: 0;
1307
+ /** The connection is open and ready to communicate. */
1308
+ static readonly OPEN: 1;
1309
+ /** The connection is in the process of closing. */
1310
+ static readonly CLOSING: 2;
1311
+ /** The connection is closed. */
1312
+ static readonly CLOSED: 3;
1313
+ binaryType: 'nodebuffer' | 'arraybuffer' | 'fragments';
1314
+ readonly bufferedAmount: number;
1315
+ readonly extensions: string;
1316
+ /** Indicates whether the websocket is paused */
1317
+ readonly isPaused: boolean;
1318
+ readonly protocol: string;
1319
+ /** The current state of the connection */
1320
+ readonly readyState: typeof WebSocket.CONNECTING | typeof WebSocket.OPEN | typeof WebSocket.CLOSING | typeof WebSocket.CLOSED;
1321
+ readonly url: string;
1322
+ /** The connection is not yet open. */
1323
+ readonly CONNECTING: 0;
1324
+ /** The connection is open and ready to communicate. */
1325
+ readonly OPEN: 1;
1326
+ /** The connection is in the process of closing. */
1327
+ readonly CLOSING: 2;
1328
+ /** The connection is closed. */
1329
+ readonly CLOSED: 3;
1330
+ onopen: ((event: WebSocket.Event) => void) | null;
1331
+ onerror: ((event: WebSocket.ErrorEvent) => void) | null;
1332
+ onclose: ((event: WebSocket.CloseEvent) => void) | null;
1333
+ onmessage: ((event: WebSocket.MessageEvent) => void) | null;
1334
+ constructor(address: null);
1335
+ constructor(address: string | url_URL, options?: WebSocket.ClientOptions | ClientRequestArgs);
1336
+ constructor(address: string | url_URL, protocols?: string | string[], options?: WebSocket.ClientOptions | ClientRequestArgs);
1337
+ close(code?: number, data?: string | Buffer): void;
1338
+ ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
1339
+ pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void;
1340
+ send(data: any, cb?: (err?: Error) => void): void;
1341
+ send(data: any, options: {
1342
+ mask?: boolean | undefined;
1343
+ binary?: boolean | undefined;
1344
+ compress?: boolean | undefined;
1345
+ fin?: boolean | undefined;
1346
+ }, cb?: (err?: Error) => void): void;
1347
+ terminate(): void;
1348
+ /**
1349
+ * Pause the websocket causing it to stop emitting events. Some events can still be
1350
+ * emitted after this is called, until all buffered data is consumed. This method
1351
+ * is a noop if the ready state is `CONNECTING` or `CLOSED`.
1352
+ */
1353
+ pause(): void;
1354
+ /**
1355
+ * Make a paused socket resume emitting events. This method is a noop if the ready
1356
+ * state is `CONNECTING` or `CLOSED`.
1357
+ */
1358
+ resume(): void; // HTML5 WebSocket events
1359
+ addEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void, options?: WebSocket.EventListenerOptions): void;
1360
+ addEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void, options?: WebSocket.EventListenerOptions): void;
1361
+ addEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void, options?: WebSocket.EventListenerOptions): void;
1362
+ addEventListener(method: 'open', cb: (event: WebSocket.Event) => void, options?: WebSocket.EventListenerOptions): void;
1363
+ removeEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void): void;
1364
+ removeEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void): void;
1365
+ removeEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void): void;
1366
+ removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void; // Events
1367
+ on(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1368
+ on(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1369
+ on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1370
+ on(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1371
+ on(event: 'open', listener: (this: WebSocket) => void): this;
1372
+ on(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1373
+ on(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1374
+ on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1375
+ once(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1376
+ once(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1377
+ once(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1378
+ once(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1379
+ once(event: 'open', listener: (this: WebSocket) => void): this;
1380
+ once(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1381
+ once(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1382
+ once(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1383
+ off(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
1384
+ off(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
1385
+ off(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
1386
+ off(event: 'message', listener: (this: WebSocket, data: WebSocket.RawData, isBinary: boolean) => void): this;
1387
+ off(event: 'open', listener: (this: WebSocket) => void): this;
1388
+ off(event: 'ping' | 'pong', listener: (this: WebSocket, data: Buffer) => void): this;
1389
+ off(event: 'unexpected-response', listener: (this: WebSocket, request: ClientRequest, response: http.IncomingMessage) => void): this;
1390
+ off(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this;
1391
+ addListener(event: 'close', listener: (code: number, reason: Buffer) => void): this;
1392
+ addListener(event: 'error', listener: (err: Error) => void): this;
1393
+ addListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
1394
+ addListener(event: 'message', listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
1395
+ addListener(event: 'open', listener: () => void): this;
1396
+ addListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this;
1397
+ addListener(event: 'unexpected-response', listener: (request: ClientRequest, response: http.IncomingMessage) => void): this;
1398
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1399
+ removeListener(event: 'close', listener: (code: number, reason: Buffer) => void): this;
1400
+ removeListener(event: 'error', listener: (err: Error) => void): this;
1401
+ removeListener(event: 'upgrade', listener: (request: http.IncomingMessage) => void): this;
1402
+ removeListener(event: 'message', listener: (data: WebSocket.RawData, isBinary: boolean) => void): this;
1403
+ removeListener(event: 'open', listener: () => void): this;
1404
+ removeListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this;
1405
+ removeListener(event: 'unexpected-response', listener: (request: ClientRequest, response: http.IncomingMessage) => void): this;
1406
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1407
+ }
1408
+ declare const WebSocketAlias: typeof WebSocket;
1409
+ interface WebSocketAlias extends WebSocket {}
1410
+ declare namespace WebSocket {
1411
+ /**
1412
+ * Data represents the raw message payload received over the WebSocket.
1413
+ */
1414
+ type RawData = Buffer | ArrayBuffer | Buffer[];
1415
+ /**
1416
+ * Data represents the message payload received over the WebSocket.
1417
+ */
1418
+ type Data = string | Buffer | ArrayBuffer | Buffer[];
1419
+ /**
1420
+ * CertMeta represents the accepted types for certificate & key data.
1421
+ */
1422
+ type CertMeta = string | string[] | Buffer | Buffer[];
1423
+ /**
1424
+ * VerifyClientCallbackSync is a synchronous callback used to inspect the
1425
+ * incoming message. The return value (boolean) of the function determines
1426
+ * whether or not to accept the handshake.
1427
+ */
1428
+ type VerifyClientCallbackSync = (info: {
1429
+ origin: string;
1430
+ secure: boolean;
1431
+ req: http.IncomingMessage;
1432
+ }) => boolean;
1433
+ /**
1434
+ * VerifyClientCallbackAsync is an asynchronous callback used to inspect the
1435
+ * incoming message. The return value (boolean) of the function determines
1436
+ * whether or not to accept the handshake.
1437
+ */
1438
+ type VerifyClientCallbackAsync = (info: {
1439
+ origin: string;
1440
+ secure: boolean;
1441
+ req: http.IncomingMessage;
1442
+ }, callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void) => void;
1443
+ interface ClientOptions extends SecureContextOptions {
1444
+ protocol?: string | undefined;
1445
+ followRedirects?: boolean | undefined;
1446
+ generateMask?(mask: Buffer): void;
1447
+ handshakeTimeout?: number | undefined;
1448
+ maxRedirects?: number | undefined;
1449
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
1450
+ localAddress?: string | undefined;
1451
+ protocolVersion?: number | undefined;
1452
+ headers?: {
1453
+ [key: string]: string;
1454
+ } | undefined;
1455
+ origin?: string | undefined;
1456
+ agent?: Agent | undefined;
1457
+ host?: string | undefined;
1458
+ family?: number | undefined;
1459
+ checkServerIdentity?(servername: string, cert: CertMeta): boolean;
1460
+ rejectUnauthorized?: boolean | undefined;
1461
+ maxPayload?: number | undefined;
1462
+ skipUTF8Validation?: boolean | undefined;
1463
+ }
1464
+ interface PerMessageDeflateOptions {
1465
+ serverNoContextTakeover?: boolean | undefined;
1466
+ clientNoContextTakeover?: boolean | undefined;
1467
+ serverMaxWindowBits?: number | undefined;
1468
+ clientMaxWindowBits?: number | undefined;
1469
+ zlibDeflateOptions?: {
1470
+ flush?: number | undefined;
1471
+ finishFlush?: number | undefined;
1472
+ chunkSize?: number | undefined;
1473
+ windowBits?: number | undefined;
1474
+ level?: number | undefined;
1475
+ memLevel?: number | undefined;
1476
+ strategy?: number | undefined;
1477
+ dictionary?: Buffer | Buffer[] | DataView | undefined;
1478
+ info?: boolean | undefined;
1479
+ } | undefined;
1480
+ zlibInflateOptions?: ZlibOptions | undefined;
1481
+ threshold?: number | undefined;
1482
+ concurrencyLimit?: number | undefined;
1483
+ }
1484
+ interface Event {
1485
+ type: string;
1486
+ target: WebSocket;
1487
+ }
1488
+ interface ErrorEvent {
1489
+ error: any;
1490
+ message: string;
1491
+ type: string;
1492
+ target: WebSocket;
1493
+ }
1494
+ interface CloseEvent {
1495
+ wasClean: boolean;
1496
+ code: number;
1497
+ reason: string;
1498
+ type: string;
1499
+ target: WebSocket;
1500
+ }
1501
+ interface MessageEvent {
1502
+ data: Data;
1503
+ type: string;
1504
+ target: WebSocket;
1505
+ }
1506
+ interface EventListenerOptions {
1507
+ once?: boolean | undefined;
1508
+ }
1509
+ interface ServerOptions {
1510
+ host?: string | undefined;
1511
+ port?: number | undefined;
1512
+ backlog?: number | undefined;
1513
+ server?: http.Server | HttpsServer | undefined;
1514
+ verifyClient?: VerifyClientCallbackAsync | VerifyClientCallbackSync | undefined;
1515
+ handleProtocols?: (protocols: Set<string>, request: http.IncomingMessage) => string | false;
1516
+ path?: string | undefined;
1517
+ noServer?: boolean | undefined;
1518
+ clientTracking?: boolean | undefined;
1519
+ perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined;
1520
+ maxPayload?: number | undefined;
1521
+ skipUTF8Validation?: boolean | undefined;
1522
+ WebSocket?: typeof WebSocket.WebSocket | undefined;
1523
+ }
1524
+ interface AddressInfo {
1525
+ address: string;
1526
+ family: string;
1527
+ port: number;
1528
+ } // WebSocket Server
1529
+ class Server<T extends WebSocket = WebSocket> extends EventEmitter {
1530
+ options: ServerOptions;
1531
+ path: string;
1532
+ clients: Set<T>;
1533
+ constructor(options?: ServerOptions, callback?: () => void);
1534
+ address(): AddressInfo | string;
1535
+ close(cb?: (err?: Error) => void): void;
1536
+ handleUpgrade(request: http.IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback: (client: T, request: http.IncomingMessage) => void): void;
1537
+ shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>; // Events
1538
+ on(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1539
+ on(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1540
+ on(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
1541
+ on(event: 'close' | 'listening', cb: (this: Server<T>) => void): this;
1542
+ on(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
1543
+ once(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1544
+ once(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1545
+ once(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
1546
+ once(event: 'close' | 'listening', cb: (this: Server<T>) => void): this;
1547
+ once(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
1548
+ off(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
1549
+ off(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
1550
+ off(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
1551
+ off(event: 'close' | 'listening', cb: (this: Server<T>) => void): this;
1552
+ off(event: string | symbol, listener: (this: Server<T>, ...args: any[]) => void): this;
1553
+ addListener(event: 'connection', cb: (client: T, request: http.IncomingMessage) => void): this;
1554
+ addListener(event: 'error', cb: (err: Error) => void): this;
1555
+ addListener(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this;
1556
+ addListener(event: 'close' | 'listening', cb: () => void): this;
1557
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1558
+ removeListener(event: 'connection', cb: (client: T) => void): this;
1559
+ removeListener(event: 'error', cb: (err: Error) => void): this;
1560
+ removeListener(event: 'headers', cb: (headers: string[], request: http.IncomingMessage) => void): this;
1561
+ removeListener(event: 'close' | 'listening', cb: () => void): this;
1562
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1563
+ }
1564
+ const WebSocketServer: typeof Server;
1565
+ interface WebSocketServer extends Server {}
1566
+ const WebSocket: typeof WebSocketAlias;
1567
+ interface WebSocket extends WebSocketAlias {} // WebSocket stream
1568
+ function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
1569
+ } // export = WebSocket
1570
+ //#endregion
1571
+ //#region src/node/server/ws.d.ts
1572
+ type WebSocketCustomListener<T> = (data: T, client: WebSocketClient) => void;
1573
+ declare const isWebSocketServer: unique symbol;
1574
+ interface WebSocketServer extends NormalizedHotChannel {
1575
+ /**
1576
+ * Handle custom event emitted by `import.meta.hot.send`
1577
+ */
1578
+ on: WebSocket.Server["on"] & {
1579
+ <T extends string>(event: T, listener: WebSocketCustomListener<hmrPayload_InferCustomEventPayload<T>>): void;
1580
+ };
1581
+ /**
1582
+ * Unregister event listener.
1583
+ */
1584
+ off: WebSocket.Server["off"] & {
1585
+ (event: string, listener: Function): void;
1586
+ };
1587
+ /**
1588
+ * Listen on port and host
1589
+ */
1590
+ listen(): void;
1591
+ /**
1592
+ * Disconnect all clients and terminate the server.
1593
+ */
1594
+ close(): Promise<void>;
1595
+ [isWebSocketServer]: true;
1596
+ /**
1597
+ * Get all connected clients.
1598
+ */
1599
+ clients: Set<WebSocketClient>;
1600
+ }
1601
+ interface WebSocketClient extends NormalizedHotChannelClient {
1602
+ /**
1603
+ * The raw WebSocket instance
1604
+ * @advanced
1605
+ */
1606
+ socket: WebSocket;
1607
+ }
1608
+ //#endregion
1609
+ //#region src/node/server/bundledDev.d.ts
1610
+ type MemoryFile = {
1611
+ source: string | Uint8Array;
1612
+ etag?: string;
1613
+ };
1614
+ declare class MemoryFiles {
1615
+ private files;
1616
+ get size(): number;
1617
+ get(file: string): MemoryFile | undefined;
1618
+ set(file: string, content: MemoryFile | (() => MemoryFile)): void;
1619
+ has(file: string): boolean;
1620
+ clear(): void;
1621
+ }
1622
+ declare class BundledDev {
1623
+ private environment;
1624
+ private _devEngine;
1625
+ private initialBuildCompleted;
1626
+ private clients;
1627
+ private invalidateCalledModules;
1628
+ private debouncedFullReload;
1629
+ private fullReloadPending;
1630
+ private lastBuildError;
1631
+ memoryFiles: MemoryFiles;
1632
+ constructor(environment: DevEnvironment);
1633
+ private get devEngine();
1634
+ listen(): Promise<void>;
1635
+ private waitForInitialBuildFinish;
1636
+ invalidateModule(m: {
1637
+ path: string;
1638
+ message?: string;
1639
+ firstInvalidatedBy: string;
1640
+ }, client: NormalizedHotChannelClient): Promise<void>;
1641
+ triggerBundleRegenerationIfStale(): Promise<boolean>;
1642
+ triggerLazyBundling(moduleId: string | null, clientId: string | null): Promise<string | undefined>;
1643
+ close(): Promise<void>;
1644
+ private getRolldownOptions;
1645
+ private handleHmrOutput;
1646
+ }
1647
+ //#endregion
1648
+ //#region src/node/server/environment.d.ts
1649
+ interface DevEnvironmentContext {
1650
+ hot: boolean;
1651
+ transport?: HotChannel | WebSocketServer;
1652
+ options?: EnvironmentOptions;
1653
+ remoteRunner?: {
1654
+ inlineSourceMap?: boolean;
1655
+ };
1656
+ depsOptimizer?: DepsOptimizer;
1657
+ }
1658
+ declare class DevEnvironment extends BaseEnvironment {
1659
+ mode: "dev";
1660
+ moduleGraph: EnvironmentModuleGraph;
1661
+ depsOptimizer?: DepsOptimizer;
1662
+ get pluginContainer(): EnvironmentPluginContainer<DevEnvironment>;
1663
+ /**
1664
+ * Hot channel for this environment. If not provided or disabled,
1665
+ * it will be a noop channel that does nothing.
1666
+ *
1667
+ * @example
1668
+ * environment.hot.send({ type: 'full-reload' })
1669
+ */
1670
+ hot: NormalizedHotChannel;
1671
+ bundledDev?: BundledDev;
1672
+ constructor(name: string, config: ResolvedConfig, context: DevEnvironmentContext);
1673
+ init(options?: {
1674
+ watcher?: FSWatcher;
1675
+ /**
1676
+ * the previous instance used for the environment with the same name
1677
+ *
1678
+ * when using, the consumer should check if it's an instance generated from the same class or factory function
1679
+ */
1680
+ previousInstance?: DevEnvironment;
1681
+ }): Promise<void>;
1682
+ /**
1683
+ * When the dev server is restarted, the methods are called in the following order:
1684
+ * - new instance `init`
1685
+ * - previous instance `close`
1686
+ * - new instance `listen`
1687
+ */
1688
+ listen(server: ViteDevServer): Promise<void>;
1689
+ /**
1690
+ * Called by the module runner to retrieve information about the specified
1691
+ * module. Internally calls `transformRequest` and wraps the result in the
1692
+ * format that the module runner understands.
1693
+ * This method is not meant to be called manually.
1694
+ */
1695
+ fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
1696
+ reloadModule(module: EnvironmentModuleNode): Promise<void>;
1697
+ transformRequest(url: string): Promise<TransformResult | null>;
1698
+ warmupRequest(url: string): Promise<void>;
1699
+ protected invalidateModule(m: {
1700
+ path: string;
1701
+ message?: string;
1702
+ firstInvalidatedBy: string;
1703
+ }, _client: NormalizedHotChannelClient): void;
1704
+ close(): Promise<void>;
1705
+ /**
1706
+ * Calling `await environment.waitForRequestsIdle(id)` will wait until all static imports
1707
+ * are processed after the first transformRequest call. If called from a load or transform
1708
+ * plugin hook, the id needs to be passed as a parameter to avoid deadlocks.
1709
+ * Calling this function after the first static imports section of the module graph has been
1710
+ * processed will resolve immediately.
1711
+ * @experimental
1712
+ */
1713
+ waitForRequestsIdle(ignoredId?: string): Promise<void>;
1714
+ }
1715
+ //#endregion
1716
+ //#region src/types/commonjs.d.ts
1717
+
1718
+ interface RollupCommonJSOptions {
1719
+ /**
1720
+ * A minimatch pattern, or array of patterns, which specifies the files in
1721
+ * the build the plugin should operate on. By default, all files with
1722
+ * extension `".cjs"` or those in `extensions` are included, but you can
1723
+ * narrow this list by only including specific files. These files will be
1724
+ * analyzed and transpiled if either the analysis does not find ES module
1725
+ * specific statements or `transformMixedEsModules` is `true`.
1726
+ * @default undefined
1727
+ */
1728
+ include?: string | RegExp | readonly (string | RegExp)[];
1729
+ /**
1730
+ * A minimatch pattern, or array of patterns, which specifies the files in
1731
+ * the build the plugin should _ignore_. By default, all files with
1732
+ * extensions other than those in `extensions` or `".cjs"` are ignored, but you
1733
+ * can exclude additional files. See also the `include` option.
1734
+ * @default undefined
1735
+ */
1736
+ exclude?: string | RegExp | readonly (string | RegExp)[];
1737
+ /**
1738
+ * For extensionless imports, search for extensions other than .js in the
1739
+ * order specified. Note that you need to make sure that non-JavaScript files
1740
+ * are transpiled by another plugin first.
1741
+ * @default [ '.js' ]
1742
+ */
1743
+ extensions?: ReadonlyArray<string>;
1744
+ /**
1745
+ * If true then uses of `global` won't be dealt with by this plugin
1746
+ * @default false
1747
+ */
1748
+ ignoreGlobal?: boolean;
1749
+ /**
1750
+ * If false, skips source map generation for CommonJS modules. This will
1751
+ * improve performance.
1752
+ * @default true
1753
+ */
1754
+ sourceMap?: boolean;
1755
+ /**
1756
+ * Some `require` calls cannot be resolved statically to be translated to
1757
+ * imports.
1758
+ * When this option is set to `false`, the generated code will either
1759
+ * directly throw an error when such a call is encountered or, when
1760
+ * `dynamicRequireTargets` is used, when such a call cannot be resolved with a
1761
+ * configured dynamic require target.
1762
+ * Setting this option to `true` will instead leave the `require` call in the
1763
+ * code or use it as a fallback for `dynamicRequireTargets`.
1764
+ * @default false
1765
+ */
1766
+ ignoreDynamicRequires?: boolean;
1767
+ /**
1768
+ * Instructs the plugin whether to enable mixed module transformations. This
1769
+ * is useful in scenarios with modules that contain a mix of ES `import`
1770
+ * statements and CommonJS `require` expressions. Set to `true` if `require`
1771
+ * calls should be transformed to imports in mixed modules, or `false` if the
1772
+ * `require` expressions should survive the transformation. The latter can be
1773
+ * important if the code contains environment detection, or you are coding
1774
+ * for an environment with special treatment for `require` calls such as
1775
+ * ElectronJS. See also the `ignore` option.
1776
+ * @default false
1777
+ */
1778
+ transformMixedEsModules?: boolean;
1779
+ /**
1780
+ * By default, this plugin will try to hoist `require` statements as imports
1781
+ * to the top of each file. While this works well for many code bases and
1782
+ * allows for very efficient ESM output, it does not perfectly capture
1783
+ * CommonJS semantics as the order of side effects like log statements may
1784
+ * change. But it is especially problematic when there are circular `require`
1785
+ * calls between CommonJS modules as those often rely on the lazy execution of
1786
+ * nested `require` calls.
1787
+ *
1788
+ * Setting this option to `true` will wrap all CommonJS files in functions
1789
+ * which are executed when they are required for the first time, preserving
1790
+ * NodeJS semantics. Note that this can have an impact on the size and
1791
+ * performance of the generated code.
1792
+ *
1793
+ * The default value of `"auto"` will only wrap CommonJS files when they are
1794
+ * part of a CommonJS dependency cycle, e.g. an index file that is required by
1795
+ * many of its dependencies. All other CommonJS files are hoisted. This is the
1796
+ * recommended setting for most code bases.
1797
+ *
1798
+ * `false` will entirely prevent wrapping and hoist all files. This may still
1799
+ * work depending on the nature of cyclic dependencies but will often cause
1800
+ * problems.
1801
+ *
1802
+ * You can also provide a minimatch pattern, or array of patterns, to only
1803
+ * specify a subset of files which should be wrapped in functions for proper
1804
+ * `require` semantics.
1805
+ *
1806
+ * `"debug"` works like `"auto"` but after bundling, it will display a warning
1807
+ * containing a list of ids that have been wrapped which can be used as
1808
+ * minimatch pattern for fine-tuning.
1809
+ * @default "auto"
1810
+ */
1811
+ strictRequires?: boolean | string | RegExp | readonly (string | RegExp)[];
1812
+ /**
1813
+ * Sometimes you have to leave require statements unconverted. Pass an array
1814
+ * containing the IDs or a `id => boolean` function.
1815
+ * @default []
1816
+ */
1817
+ ignore?: ReadonlyArray<string> | ((id: string) => boolean);
1818
+ /**
1819
+ * In most cases, where `require` calls are inside a `try-catch` clause,
1820
+ * they should be left unconverted as it requires an optional dependency
1821
+ * that may or may not be installed beside the rolled up package.
1822
+ * Due to the conversion of `require` to a static `import` - the call is
1823
+ * hoisted to the top of the file, outside the `try-catch` clause.
1824
+ *
1825
+ * - `true`: Default. All `require` calls inside a `try` will be left unconverted.
1826
+ * - `false`: All `require` calls inside a `try` will be converted as if the
1827
+ * `try-catch` clause is not there.
1828
+ * - `remove`: Remove all `require` calls from inside any `try` block.
1829
+ * - `string[]`: Pass an array containing the IDs to left unconverted.
1830
+ * - `((id: string) => boolean|'remove')`: Pass a function that controls
1831
+ * individual IDs.
1832
+ *
1833
+ * @default true
1834
+ */
1835
+ ignoreTryCatch?: boolean | 'remove' | ReadonlyArray<string> | ((id: string) => boolean | 'remove');
1836
+ /**
1837
+ * Controls how to render imports from external dependencies. By default,
1838
+ * this plugin assumes that all external dependencies are CommonJS. This
1839
+ * means they are rendered as default imports to be compatible with e.g.
1840
+ * NodeJS where ES modules can only import a default export from a CommonJS
1841
+ * dependency.
1842
+ *
1843
+ * If you set `esmExternals` to `true`, this plugin assumes that all
1844
+ * external dependencies are ES modules and respect the
1845
+ * `requireReturnsDefault` option. If that option is not set, they will be
1846
+ * rendered as namespace imports.
1847
+ *
1848
+ * You can also supply an array of ids to be treated as ES modules, or a
1849
+ * function that will be passed each external id to determine whether it is
1850
+ * an ES module.
1851
+ * @default false
1852
+ */
1853
+ esmExternals?: boolean | ReadonlyArray<string> | ((id: string) => boolean);
1854
+ /**
1855
+ * Controls what is returned when requiring an ES module from a CommonJS file.
1856
+ * When using the `esmExternals` option, this will also apply to external
1857
+ * modules. By default, this plugin will render those imports as namespace
1858
+ * imports i.e.
1859
+ *
1860
+ * ```js
1861
+ * // input
1862
+ * const foo = require('foo');
1863
+ *
1864
+ * // output
1865
+ * import * as foo from 'foo';
1866
+ * ```
1867
+ *
1868
+ * However, there are some situations where this may not be desired.
1869
+ * For these situations, you can change Rollup's behaviour either globally or
1870
+ * per module. To change it globally, set the `requireReturnsDefault` option
1871
+ * to one of the following values:
1872
+ *
1873
+ * - `false`: This is the default, requiring an ES module returns its
1874
+ * namespace. This is the only option that will also add a marker
1875
+ * `__esModule: true` to the namespace to support interop patterns in
1876
+ * CommonJS modules that are transpiled ES modules.
1877
+ * - `"namespace"`: Like `false`, requiring an ES module returns its
1878
+ * namespace, but the plugin does not add the `__esModule` marker and thus
1879
+ * creates more efficient code. For external dependencies when using
1880
+ * `esmExternals: true`, no additional interop code is generated.
1881
+ * - `"auto"`: This is complementary to how `output.exports: "auto"` works in
1882
+ * Rollup: If a module has a default export and no named exports, requiring
1883
+ * that module returns the default export. In all other cases, the namespace
1884
+ * is returned. For external dependencies when using `esmExternals: true`, a
1885
+ * corresponding interop helper is added.
1886
+ * - `"preferred"`: If a module has a default export, requiring that module
1887
+ * always returns the default export, no matter whether additional named
1888
+ * exports exist. This is similar to how previous versions of this plugin
1889
+ * worked. Again for external dependencies when using `esmExternals: true`,
1890
+ * an interop helper is added.
1891
+ * - `true`: This will always try to return the default export on require
1892
+ * without checking if it actually exists. This can throw at build time if
1893
+ * there is no default export. This is how external dependencies are handled
1894
+ * when `esmExternals` is not used. The advantage over the other options is
1895
+ * that, like `false`, this does not add an interop helper for external
1896
+ * dependencies, keeping the code lean.
1897
+ *
1898
+ * To change this for individual modules, you can supply a function for
1899
+ * `requireReturnsDefault` instead. This function will then be called once for
1900
+ * each required ES module or external dependency with the corresponding id
1901
+ * and allows you to return different values for different modules.
1902
+ * @default false
1903
+ */
1904
+ requireReturnsDefault?: boolean | 'auto' | 'preferred' | 'namespace' | ((id: string) => boolean | 'auto' | 'preferred' | 'namespace');
1905
+ /**
1906
+ * @default "auto"
1907
+ */
1908
+ defaultIsModuleExports?: boolean | 'auto' | ((id: string) => boolean | 'auto');
1909
+ /**
1910
+ * Some modules contain dynamic `require` calls, or require modules that
1911
+ * contain circular dependencies, which are not handled well by static
1912
+ * imports. Including those modules as `dynamicRequireTargets` will simulate a
1913
+ * CommonJS (NodeJS-like) environment for them with support for dynamic
1914
+ * dependencies. It also enables `strictRequires` for those modules.
1915
+ *
1916
+ * Note: In extreme cases, this feature may result in some paths being
1917
+ * rendered as absolute in the final bundle. The plugin tries to avoid
1918
+ * exposing paths from the local machine, but if you are `dynamicRequirePaths`
1919
+ * with paths that are far away from your project's folder, that may require
1920
+ * replacing strings like `"/Users/John/Desktop/foo-project/"` -\> `"/"`.
1921
+ */
1922
+ dynamicRequireTargets?: string | ReadonlyArray<string>;
1923
+ /**
1924
+ * To avoid long paths when using the `dynamicRequireTargets` option, you can use this option to specify a directory
1925
+ * that is a common parent for all files that use dynamic require statements. Using a directory higher up such as `/`
1926
+ * may lead to unnecessarily long paths in the generated code and may expose directory names on your machine like your
1927
+ * home directory name. By default, it uses the current working directory.
1928
+ */
1929
+ dynamicRequireRoot?: string;
1930
+ }
1931
+ //#endregion
1932
+ //#region src/types/dynamicImportVars.d.ts
1933
+ interface RollupDynamicImportVarsOptions {
1934
+ /**
1935
+ * Files to include in this plugin (default all).
1936
+ * @default []
1937
+ */
1938
+ include?: string | RegExp | (string | RegExp)[];
1939
+ /**
1940
+ * Files to exclude in this plugin (default none).
1941
+ * @default []
1942
+ */
1943
+ exclude?: string | RegExp | (string | RegExp)[];
1944
+ /**
1945
+ * @deprecated This option is no-op and will be removed in future versions.
1946
+ */
1947
+ warnOnError?: boolean;
1948
+ }
1949
+ //#endregion
1950
+ //#region src/node/plugins/terser.d.ts
1951
+ interface TerserOptions extends TerserMinifyOptions {
1952
+ /**
1953
+ * Vite-specific option to specify the max number of workers to spawn
1954
+ * when minifying files with terser.
1955
+ *
1956
+ * @default number of CPUs minus 1
1957
+ */
1958
+ maxWorkers?: number;
1959
+ }
1960
+ //#endregion
1961
+ //#region src/node/plugins/resolve.d.ts
1962
+ interface EnvironmentResolveOptions {
1963
+ /**
1964
+ * @default ['browser', 'module', 'jsnext:main', 'jsnext']
1965
+ */
1966
+ mainFields?: string[];
1967
+ conditions?: string[];
1968
+ externalConditions?: string[];
1969
+ /**
1970
+ * @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
1971
+ */
1972
+ extensions?: string[];
1973
+ dedupe?: string[];
1974
+ /**
1975
+ * Prevent listed dependencies from being externalized and will get bundled in build.
1976
+ * Only works in server environments for now. Previously this was `ssr.noExternal`.
1977
+ * @experimental
1978
+ */
1979
+ noExternal?: string | RegExp | (string | RegExp)[] | true;
1980
+ /**
1981
+ * Externalize the given dependencies and their transitive dependencies.
1982
+ * Only works in server environments for now. Previously this was `ssr.external`.
1983
+ * @experimental
1984
+ */
1985
+ external?: string[] | true;
1986
+ /**
1987
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
1988
+ */
1989
+ builtins?: (string | RegExp)[];
1990
+ }
1991
+ interface ResolveOptions extends EnvironmentResolveOptions {
1992
+ /**
1993
+ * @default false
1994
+ */
1995
+ preserveSymlinks?: boolean;
1996
+ /**
1997
+ * Enable tsconfig paths resolution
1998
+ *
1999
+ * @default false
2000
+ * @experimental
2001
+ */
2002
+ tsconfigPaths?: boolean;
2003
+ }
2004
+ interface ResolvePluginOptions {
2005
+ root: string;
2006
+ isBuild: boolean;
2007
+ isProduction: boolean;
2008
+ packageCache?: PackageCache;
2009
+ /**
2010
+ * src code mode also attempts the following:
2011
+ * - resolving /xxx as URLs
2012
+ * - resolving bare imports from optimized deps
2013
+ */
2014
+ asSrc?: boolean;
2015
+ tryIndex?: boolean;
2016
+ tryPrefix?: string;
2017
+ preferRelative?: boolean;
2018
+ isRequire?: boolean;
2019
+ scan?: boolean;
2020
+ /**
2021
+ * Enable when `legacy.inconsistentCjsInterop` is true. See that option for more details.
2022
+ */
2023
+ legacyInconsistentCjsInterop?: boolean;
2024
+ }
2025
+ interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {}
2026
+ //#endregion
2027
+ //#region src/node/packages.d.ts
2028
+ /** Cache for package.json resolution and package.json contents */
2029
+ type PackageCache = Map<string, PackageData>;
2030
+ interface PackageData {
2031
+ dir: string;
2032
+ hasSideEffects: (id: string) => boolean | "no-treeshake" | null;
2033
+ setResolvedCache: (key: string, entry: string, options: InternalResolveOptions) => void;
2034
+ getResolvedCache: (key: string, options: InternalResolveOptions) => string | undefined;
2035
+ data: {
2036
+ [field: string]: any;
2037
+ name: string;
2038
+ type: string;
2039
+ version: string;
2040
+ main: string;
2041
+ module: string;
2042
+ browser: string | Record<string, string | false>;
2043
+ exports: string | Record<string, any> | string[];
2044
+ imports: Record<string, any>;
2045
+ dependencies: Record<string, string>;
2046
+ };
2047
+ }
2048
+ //#endregion
2049
+ //#region src/node/plugins/license.d.ts
2050
+ interface LicenseOptions {
2051
+ /**
2052
+ * The output file name of the license file relative to the output directory.
2053
+ * Specify a path that ends with `.json` to output the raw JSON metadata.
2054
+ *
2055
+ * @default '.vite/license.md'
2056
+ */
2057
+ fileName: string;
2058
+ }
2059
+ //#endregion
2060
+ //#region src/node/build.d.ts
2061
+ interface BuildEnvironmentOptions {
2062
+ /**
2063
+ * Compatibility transform target. The transform is performed with esbuild
2064
+ * and the lowest supported target is es2015. Note this only handles
2065
+ * syntax transformation and does not cover polyfills
2066
+ *
2067
+ * Default: 'baseline-widely-available' - transpile targeting browsers that
2068
+ * are included in the Baseline Widely Available on 2026-01-01.
2069
+ * (Chrome 111+, Edge 111+, Firefox 114+, Safari 16.4+).
2070
+ *
2071
+ * Another special value is 'esnext' - which only performs minimal transpiling
2072
+ * (for minification compat).
2073
+ *
2074
+ * For custom targets, see https://esbuild.github.io/api/#target and
2075
+ * https://esbuild.github.io/content-types/#javascript for more details.
2076
+ * @default 'baseline-widely-available'
2077
+ */
2078
+ target?: "baseline-widely-available" | EsbuildTarget | false;
2079
+ /**
2080
+ * whether to inject module preload polyfill.
2081
+ * Note: does not apply to library mode.
2082
+ * @default true
2083
+ * @deprecated use `modulePreload.polyfill` instead
2084
+ */
2085
+ polyfillModulePreload?: boolean;
2086
+ /**
2087
+ * Configure module preload
2088
+ * Note: does not apply to library mode.
2089
+ * @default true
2090
+ */
2091
+ modulePreload?: boolean | ModulePreloadOptions;
2092
+ /**
2093
+ * Directory relative from `root` where build output will be placed. If the
2094
+ * directory exists, it will be removed before the build.
2095
+ * @default 'dist'
2096
+ */
2097
+ outDir?: string;
2098
+ /**
2099
+ * Directory relative from `outDir` where the built js/css/image assets will
2100
+ * be placed.
2101
+ * @default 'assets'
2102
+ */
2103
+ assetsDir?: string;
2104
+ /**
2105
+ * Static asset files smaller than this number (in bytes) will be inlined as
2106
+ * base64 strings. If a callback is passed, a boolean can be returned to opt-in
2107
+ * or opt-out of inlining. If nothing is returned the default logic applies.
2108
+ *
2109
+ * Default limit is `4096` (4 KiB). Set to `0` to disable.
2110
+ * @default 4096
2111
+ */
2112
+ assetsInlineLimit?: number | ((filePath: string, content: Buffer) => boolean | undefined);
2113
+ /**
2114
+ * Whether to code-split CSS. When enabled, CSS in async chunks will be
2115
+ * inlined as strings in the chunk and inserted via dynamically created
2116
+ * style tags when the chunk is loaded.
2117
+ * @default true
2118
+ */
2119
+ cssCodeSplit?: boolean;
2120
+ /**
2121
+ * An optional separate target for CSS minification.
2122
+ * As esbuild only supports configuring targets to mainstream
2123
+ * browsers, users may need this option when they are targeting
2124
+ * a niche browser that comes with most modern JavaScript features
2125
+ * but has poor CSS support, e.g. Android WeChat WebView, which
2126
+ * doesn't support the #RGBA syntax.
2127
+ * @default target
2128
+ */
2129
+ cssTarget?: EsbuildTarget | false;
2130
+ /**
2131
+ * Override CSS minification specifically instead of defaulting to `build.minify`,
2132
+ * so you can configure minification for JS and CSS separately.
2133
+ * @default 'lightningcss'
2134
+ */
2135
+ cssMinify?: boolean | "lightningcss" | "esbuild";
2136
+ /**
2137
+ * If `true`, a separate sourcemap file will be created. If 'inline', the
2138
+ * sourcemap will be appended to the resulting output file as data URI.
2139
+ * 'hidden' works like `true` except that the corresponding sourcemap
2140
+ * comments in the bundled files are suppressed.
2141
+ * @default false
2142
+ */
2143
+ sourcemap?: boolean | "inline" | "hidden";
2144
+ /**
2145
+ * Set to `false` to disable minification, or specify the minifier to use.
2146
+ * Available options are 'oxc' or 'terser' or 'esbuild'.
2147
+ * @default 'oxc'
2148
+ */
2149
+ minify?: boolean | "oxc" | "terser" | "esbuild";
2150
+ /**
2151
+ * Options for terser
2152
+ * https://terser.org/docs/api-reference#minify-options
2153
+ *
2154
+ * In addition, you can also pass a `maxWorkers: number` option to specify the
2155
+ * max number of workers to spawn. Defaults to the number of CPUs minus 1.
2156
+ */
2157
+ terserOptions?: TerserOptions;
2158
+ /**
2159
+ * Whether to use import maps feature to optimize chunk caching efficiency.
2160
+ * @default false
2161
+ * @experimental
2162
+ */
2163
+ chunkImportMap?: boolean;
2164
+ /**
2165
+ * Alias to `rolldownOptions`
2166
+ * @deprecated Use `rolldownOptions` instead.
2167
+ */
2168
+ rollupOptions?: RolldownOptions;
2169
+ /**
2170
+ * Will be merged with internal rolldown options.
2171
+ * https://rolldown.rs/reference/Interface.RolldownOptions
2172
+ */
2173
+ rolldownOptions?: RolldownOptions;
2174
+ /**
2175
+ * Options to pass on to `@rollup/plugin-commonjs`
2176
+ * @deprecated This option is no-op and will be removed in future versions.
2177
+ */
2178
+ commonjsOptions?: RollupCommonJSOptions;
2179
+ /**
2180
+ * Options to pass on to `@rollup/plugin-dynamic-import-vars`
2181
+ */
2182
+ dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
2183
+ /**
2184
+ * Whether to write bundle to disk
2185
+ * @default true
2186
+ */
2187
+ write?: boolean;
2188
+ /**
2189
+ * Empty outDir on write.
2190
+ * @default true when outDir is a sub directory of project root
2191
+ */
2192
+ emptyOutDir?: boolean | null;
2193
+ /**
2194
+ * Copy the public directory to outDir on write.
2195
+ * @default true
2196
+ */
2197
+ copyPublicDir?: boolean;
2198
+ /**
2199
+ * Whether to emit a `.vite/license.md` file that includes all bundled dependencies'
2200
+ * licenses. Pass an object to customize the output file name.
2201
+ * @default false
2202
+ */
2203
+ license?: boolean | LicenseOptions;
2204
+ /**
2205
+ * Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
2206
+ * to their hashed versions. Useful when you want to generate your own HTML
2207
+ * instead of using the one generated by Vite.
2208
+ *
2209
+ * Example:
2210
+ *
2211
+ * ```json
2212
+ * {
2213
+ * "main.js": {
2214
+ * "file": "main.68fe3fad.js",
2215
+ * "css": "main.e6b63442.css",
2216
+ * "imports": [...],
2217
+ * "dynamicImports": [...]
2218
+ * }
2219
+ * }
2220
+ * ```
2221
+ * @default false
2222
+ */
2223
+ manifest?: boolean | string;
2224
+ /**
2225
+ * Build in library mode. The value should be the global name of the lib in
2226
+ * UMD mode. This will produce esm + cjs + umd bundle formats with default
2227
+ * configurations that are suitable for distributing libraries.
2228
+ * @default false
2229
+ */
2230
+ lib?: LibraryOptions | false;
2231
+ /**
2232
+ * Produce SSR oriented build. Note this requires specifying SSR entry via
2233
+ * `rolldownOptions.input`.
2234
+ * @default false
2235
+ */
2236
+ ssr?: boolean | string;
2237
+ /**
2238
+ * Generate SSR manifest for determining style links and asset preload
2239
+ * directives in production.
2240
+ * @default false
2241
+ */
2242
+ ssrManifest?: boolean | string;
2243
+ /**
2244
+ * Emit assets during SSR.
2245
+ * @default false
2246
+ */
2247
+ ssrEmitAssets?: boolean;
2248
+ /**
2249
+ * Emit assets during build. Frameworks can set environments.ssr.build.emitAssets
2250
+ * By default, it is true for the client and false for other environments.
2251
+ */
2252
+ emitAssets?: boolean;
2253
+ /**
2254
+ * Set to false to disable reporting compressed chunk sizes.
2255
+ * Can slightly improve build speed.
2256
+ * @default true
2257
+ */
2258
+ reportCompressedSize?: boolean;
2259
+ /**
2260
+ * Adjust chunk size warning limit (in kB).
2261
+ * @default 500
2262
+ */
2263
+ chunkSizeWarningLimit?: number;
2264
+ /**
2265
+ * Rollup watch options
2266
+ * https://rollupjs.org/configuration-options/#watch
2267
+ * @default null
2268
+ */
2269
+ watch?: WatcherOptions | null;
2270
+ /**
2271
+ * create the Build Environment instance
2272
+ */
2273
+ createEnvironment?: (name: string, config: ResolvedConfig) => Promise<BuildEnvironment> | BuildEnvironment;
2274
+ }
2275
+ type BuildOptions = BuildEnvironmentOptions;
2276
+ interface LibraryOptions {
2277
+ /**
2278
+ * Path of library entry
2279
+ */
2280
+ entry: InputOption;
2281
+ /**
2282
+ * The name of the exposed global variable. Required when the `formats` option includes
2283
+ * `umd` or `iife`
2284
+ */
2285
+ name?: string;
2286
+ /**
2287
+ * Output bundle formats
2288
+ * @default ['es', 'umd']
2289
+ */
2290
+ formats?: LibraryFormats[];
2291
+ /**
2292
+ * The name of the package file output. The default file name is the name option
2293
+ * of the project package.json. It can also be defined as a function taking the
2294
+ * format as an argument.
2295
+ */
2296
+ fileName?: string | ((format: ModuleFormat, entryName: string) => string);
2297
+ /**
2298
+ * The name of the CSS file output if the library imports CSS. Defaults to the
2299
+ * same value as `build.lib.fileName` if it's set a string, otherwise it falls
2300
+ * back to the name option of the project package.json.
2301
+ */
2302
+ cssFileName?: string;
2303
+ }
2304
+ type LibraryFormats = "es" | "cjs" | "umd" | "iife";
2305
+ interface ModulePreloadOptions {
2306
+ /**
2307
+ * Whether to inject a module preload polyfill.
2308
+ * Note: does not apply to library mode.
2309
+ * @default true
2310
+ */
2311
+ polyfill?: boolean;
2312
+ /**
2313
+ * Resolve the list of dependencies to preload for a given dynamic import
2314
+ * @experimental
2315
+ */
2316
+ resolveDependencies?: ResolveModulePreloadDependenciesFn;
2317
+ }
2318
+ interface ResolvedModulePreloadOptions {
2319
+ polyfill: boolean;
2320
+ resolveDependencies?: ResolveModulePreloadDependenciesFn;
2321
+ }
2322
+ type ResolveModulePreloadDependenciesFn = (filename: string, deps: string[], context: {
2323
+ hostId: string;
2324
+ hostType: "html" | "js";
2325
+ }) => string[];
2326
+ interface ResolvedBuildEnvironmentOptions extends Required<Omit<BuildEnvironmentOptions, "polyfillModulePreload">> {
2327
+ modulePreload: false | ResolvedModulePreloadOptions;
2328
+ }
2329
+ interface ResolvedBuildOptions extends Required<Omit<BuildOptions, "polyfillModulePreload">> {
2330
+ modulePreload: false | ResolvedModulePreloadOptions;
2331
+ }
2332
+ /**
2333
+ * Bundles a single environment for production.
2334
+ * Returns a Promise containing the build result.
2335
+ */
2336
+ declare function build(inlineConfig?: InlineConfig): Promise<RolldownOutput | RolldownOutput[] | RolldownWatcher>;
2337
+ type RenderBuiltAssetUrl = (filename: string, type: {
2338
+ type: "asset" | "public";
2339
+ hostId: string;
2340
+ hostType: "js" | "css" | "html";
2341
+ ssr: boolean;
2342
+ }) => string | {
2343
+ relative?: boolean;
2344
+ runtime?: string;
2345
+ } | undefined;
2346
+ declare class BuildEnvironment extends BaseEnvironment {
2347
+ mode: "build";
2348
+ isBuilt: boolean;
2349
+ constructor(name: string, config: ResolvedConfig, setup?: {
2350
+ options?: EnvironmentOptions;
2351
+ });
2352
+ init(): Promise<void>;
2353
+ }
2354
+ interface ViteBuilder {
2355
+ environments: Record<string, BuildEnvironment>;
2356
+ config: ResolvedConfig;
2357
+ buildApp(): Promise<void>;
2358
+ build(environment: BuildEnvironment): Promise<RolldownOutput | RolldownOutput[] | RolldownWatcher>;
2359
+ runDevTools(): Promise<void>;
2360
+ }
2361
+ interface BuilderOptions {
2362
+ /**
2363
+ * Whether to share the config instance among environments to align with the behavior of dev server.
2364
+ *
2365
+ * @default false
2366
+ * @experimental
2367
+ */
2368
+ sharedConfigBuild?: boolean;
2369
+ /**
2370
+ * Whether to share the plugin instances among environments to align with the behavior of dev server.
2371
+ *
2372
+ * @default false
2373
+ * @experimental
2374
+ */
2375
+ sharedPlugins?: boolean;
2376
+ buildApp?: (builder: ViteBuilder) => Promise<void>;
2377
+ }
2378
+ type ResolvedBuilderOptions = Required<BuilderOptions>;
2379
+ /**
2380
+ * Creates a ViteBuilder to orchestrate building multiple environments.
2381
+ * @experimental
2382
+ */
2383
+ declare function createBuilder(inlineConfig?: InlineConfig, useLegacyBuilder?: null | boolean): Promise<ViteBuilder>;
2384
+ type BuildAppHook = (this: MinimalPluginContextWithoutEnvironment, builder: ViteBuilder) => Promise<void>;
2385
+ //#endregion
2386
+ //#region src/node/environment.d.ts
2387
+ type Environment = DevEnvironment | BuildEnvironment | ScanEnvironment | UnknownEnvironment;
2388
+ /**
2389
+ * Creates a function that hides the complexities of a WeakMap with an initial value
2390
+ * to implement object metadata. Used by plugins to implement cross hooks per
2391
+ * environment metadata
2392
+ *
2393
+ * @experimental
2394
+ */
2395
+ declare function perEnvironmentState<State>(initial: (environment: Environment) => State): (context: PluginContext) => State;
2396
+ //#endregion
2397
+ //#region src/node/server/pluginContainer.d.ts
2398
+ type SkipInformation = {
2399
+ id: string;
2400
+ importer: string | undefined;
2401
+ plugin: Plugin;
2402
+ called?: boolean;
2403
+ };
2404
+ declare class EnvironmentPluginContainer<Env extends Environment = Environment> {
2405
+ private _pluginContextMap;
2406
+ private _resolvedRolldownOptions?;
2407
+ private _processesing;
2408
+ private _seenResolves;
2409
+ private _moduleNodeToLoadAddedImports;
2410
+ getSortedPluginHooks: PluginHookUtils["getSortedPluginHooks"];
2411
+ getSortedPlugins: PluginHookUtils["getSortedPlugins"];
2412
+ moduleGraph: EnvironmentModuleGraph | undefined;
2413
+ watchFiles: Set<string>;
2414
+ minimalContext: MinimalPluginContext$1<Env>;
2415
+ private _started;
2416
+ private _buildStartPromise;
2417
+ private _closed;
2418
+ private _updateModuleLoadAddedImports;
2419
+ private _getAddedImports;
2420
+ getModuleInfo(id: string): ModuleInfo | null;
2421
+ private handleHookPromise;
2422
+ get options(): InputOptions;
2423
+ resolveRolldownOptions(): Promise<InputOptions>;
2424
+ private _getPluginContext;
2425
+ private hookParallel;
2426
+ buildStart(_options?: InputOptions): Promise<void>;
2427
+ resolveId(rawId: string, importer?: string | undefined, options?: {
2428
+ kind?: ImportKind;
2429
+ attributes?: Record<string, string>;
2430
+ custom?: CustomPluginOptions; /** @deprecated use `skipCalls` instead */
2431
+ skip?: Set<Plugin>;
2432
+ skipCalls?: readonly SkipInformation[];
2433
+
2434
+ isEntry?: boolean;
2435
+ }): Promise<PartialResolvedId | null>;
2436
+ load(id: string): Promise<LoadResult | null>;
2437
+ transform(code: string, id: string, options?: {
2438
+ inMap?: SourceDescription["map"];
2439
+ moduleType?: string;
2440
+ }): Promise<{
2441
+ code: string;
2442
+ map: SourceMap | {
2443
+ mappings: "";
2444
+ } | null;
2445
+ moduleType?: ModuleType;
2446
+ }>;
2447
+ watchChange(id: string, change: {
2448
+ event: "create" | "update" | "delete";
2449
+ }): Promise<void>;
2450
+ close(): Promise<void>;
2451
+ }
2452
+ declare class BasicMinimalPluginContext<Meta = PluginContextMeta> {
2453
+ meta: Meta;
2454
+ private _logger;
2455
+ constructor(meta: Meta, _logger: Logger);
2456
+ get pluginName(): string;
2457
+ debug(rawLog: string | RollupLog | (() => string | RollupLog)): void;
2458
+ info(rawLog: string | RollupLog | (() => string | RollupLog)): void;
2459
+ warn(rawLog: string | RollupLog | (() => string | RollupLog)): void;
2460
+ error(e: string | RollupError): never;
2461
+ private _normalizeRawLog;
2462
+ }
2463
+ declare class MinimalPluginContext$1<T extends Environment = Environment> extends BasicMinimalPluginContext implements MinimalPluginContext {
2464
+ environment: T;
2465
+ constructor(meta: PluginContextMeta, environment: T);
2466
+ }
2467
+ declare class PluginContainer {
2468
+ private environments;
2469
+ constructor(environments: Record<string, Environment>);
2470
+ private _getEnvironment;
2471
+ private _getPluginContainer;
2472
+ getModuleInfo(id: string): ModuleInfo | null;
2473
+ get options(): InputOptions;
2474
+ buildStart(_options?: InputOptions): Promise<void>;
2475
+ watchChange(id: string, change: {
2476
+ event: "create" | "update" | "delete";
2477
+ }): Promise<void>;
2478
+ resolveId(rawId: string, importer?: string, options?: {
2479
+ attributes?: Record<string, string>;
2480
+ custom?: CustomPluginOptions; /** @deprecated use `skipCalls` instead */
2481
+ skip?: Set<Plugin>;
2482
+ skipCalls?: readonly SkipInformation[];
2483
+ ssr?: boolean;
2484
+
2485
+ isEntry?: boolean;
2486
+ }): Promise<PartialResolvedId | null>;
2487
+ load(id: string, options?: {
2488
+ ssr?: boolean;
2489
+ }): Promise<LoadResult | null>;
2490
+ transform(code: string, id: string, options?: {
2491
+ ssr?: boolean;
2492
+ environment?: Environment;
2493
+ inMap?: SourceDescription["map"];
2494
+ }): Promise<{
2495
+ code: string;
2496
+ map: SourceMap | {
2497
+ mappings: "";
2498
+ } | null;
2499
+ }>;
2500
+ close(): Promise<void>;
2501
+ }
2502
+ /**
2503
+ * server.pluginContainer compatibility
2504
+ *
2505
+ * The default environment is in buildStart, buildEnd, watchChange, and closeBundle hooks,
2506
+ * which are called once for all environments, or when no environment is passed in other hooks.
2507
+ * The ssrEnvironment is needed for backward compatibility when the ssr flag is passed without
2508
+ * an environment. The defaultEnvironment in the main pluginContainer in the server should be
2509
+ * the client environment for backward compatibility.
2510
+ **/
2511
+ //#endregion
2512
+ //#region src/node/server/index.d.ts
2513
+ interface ServerOptions$1 extends CommonServerOptions {
2514
+ /**
2515
+ * Configure HMR-specific options (port, host, path & protocol)
2516
+ */
2517
+ hmr?: HmrOptions | boolean;
2518
+ /**
2519
+ * Configure WebSocket connection options.
2520
+ * Set to `false` to disable the WebSocket server and connection.
2521
+ */
2522
+ ws?: WsOptions | false;
2523
+ /**
2524
+ * Warm-up files to transform and cache the results in advance. This improves the
2525
+ * initial page load during server starts and prevents transform waterfalls.
2526
+ */
2527
+ warmup?: {
2528
+ /**
2529
+ * The files to be transformed and used on the client-side. Supports glob patterns.
2530
+ */
2531
+ clientFiles?: string[];
2532
+ /**
2533
+ * The files to be transformed and used in SSR. Supports glob patterns.
2534
+ */
2535
+ ssrFiles?: string[];
2536
+ };
2537
+ /**
2538
+ * chokidar watch options or null to disable FS watching
2539
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2540
+ */
2541
+ watch?: WatchOptions | null;
2542
+ /**
2543
+ * Create Vite dev server to be used as a middleware in an existing server
2544
+ * @default false
2545
+ */
2546
+ middlewareMode?: boolean | {
2547
+ /**
2548
+ * Parent server instance to attach to
2549
+ *
2550
+ * This is needed to proxy WebSocket connections to the parent server.
2551
+ */
2552
+ server: HttpServer;
2553
+ };
2554
+ /**
2555
+ * Options for files served via '/\@fs/'.
2556
+ */
2557
+ fs?: FileSystemServeOptions;
2558
+ /**
2559
+ * Origin for the generated asset URLs.
2560
+ *
2561
+ * @example `http://127.0.0.1:8080`
2562
+ */
2563
+ origin?: string;
2564
+ /**
2565
+ * Pre-transform known direct imports
2566
+ * @default true
2567
+ */
2568
+ preTransformRequests?: boolean;
2569
+ /**
2570
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
2571
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
2572
+ *
2573
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
2574
+ * disable this behavior, or, for full control, a function that takes the source path and
2575
+ * sourcemap path and returns whether to ignore the source path.
2576
+ */
2577
+ sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
2578
+ /**
2579
+ * Backward compatibility. The buildStart and buildEnd hooks were called only once for
2580
+ * the client environment. This option enables per-environment buildStart and buildEnd hooks.
2581
+ * @default false
2582
+ * @experimental
2583
+ */
2584
+ perEnvironmentStartEndDuringDev?: boolean;
2585
+ /**
2586
+ * Backward compatibility. The watchChange hook was called only once for the client environment.
2587
+ * This option enables per-environment watchChange hooks.
2588
+ * @default false
2589
+ * @experimental
2590
+ */
2591
+ perEnvironmentWatchChangeDuringDev?: boolean;
2592
+ /**
2593
+ * Run HMR tasks, by default the HMR propagation is done in parallel for all environments
2594
+ * @experimental
2595
+ */
2596
+ hotUpdateEnvironments?: (server: ViteDevServer, hmr: (environment: DevEnvironment) => Promise<void>) => Promise<void>;
2597
+ forwardConsole?: boolean | ForwardConsoleOptions;
2598
+ }
2599
+ interface ResolvedServerOptions extends Omit<RequiredExceptFor<ServerOptions$1, "host" | "https" | "proxy" | "hmr" | "ws" | "watch" | "origin" | "hotUpdateEnvironments">, "fs" | "middlewareMode" | "sourcemapIgnoreList" | "forwardConsole"> {
2600
+ fs: Required<FileSystemServeOptions>;
2601
+ middlewareMode: NonNullable<ServerOptions$1["middlewareMode"]>;
2602
+ sourcemapIgnoreList: Exclude<ServerOptions$1["sourcemapIgnoreList"], false | undefined>;
2603
+ forwardConsole: ResolvedForwardConsoleOptions;
2604
+ }
2605
+ interface FileSystemServeOptions {
2606
+ /**
2607
+ * Strictly restrict file accessing outside of allowing paths.
2608
+ *
2609
+ * Set to `false` to disable the warning
2610
+ *
2611
+ * @default true
2612
+ */
2613
+ strict?: boolean;
2614
+ /**
2615
+ * Restrict accessing files outside the allowed directories.
2616
+ *
2617
+ * Accepts absolute path or a path relative to project root.
2618
+ * Will try to search up for workspace root by default.
2619
+ */
2620
+ allow?: string[];
2621
+ /**
2622
+ * Restrict accessing files that matches the patterns.
2623
+ *
2624
+ * This will have higher priority than `allow`.
2625
+ * picomatch patterns are supported.
2626
+ *
2627
+ * @default ['.env', '.env.*', '*.{crt,pem,key,p12,pfx,cer,der}', '.npmrc', '.yarnrc.yml', '**\/.git/**']
2628
+ */
2629
+ deny?: string[];
2630
+ }
2631
+ type ServerHook = (this: MinimalPluginContextWithoutEnvironment, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
2632
+ type HttpServer = http.Server | Http2SecureServer;
2633
+ interface ViteDevServer {
2634
+ /**
2635
+ * The resolved vite config object
2636
+ */
2637
+ config: ResolvedConfig;
2638
+ /**
2639
+ * A connect app instance.
2640
+ * - Can be used to attach custom middlewares to the dev server.
2641
+ * - Can also be used as the handler function of a custom http server
2642
+ * or as a middleware in any connect-style Node.js frameworks
2643
+ *
2644
+ * https://github.com/senchalabs/connect#use-middleware
2645
+ */
2646
+ middlewares: Connect.Server;
2647
+ /**
2648
+ * native Node http server instance
2649
+ * will be null in middleware mode
2650
+ */
2651
+ httpServer: HttpServer | null;
2652
+ /**
2653
+ * Chokidar watcher instance. If `config.server.watch` is set to `null`,
2654
+ * it will not watch any files and calling `add` or `unwatch` will have no effect.
2655
+ * https://github.com/paulmillr/chokidar/tree/3.6.0#api
2656
+ */
2657
+ watcher: FSWatcher;
2658
+ /**
2659
+ * WebSocket server with `send(payload)` method
2660
+ */
2661
+ ws: WebSocketServer;
2662
+ /**
2663
+ * An alias to `server.environments.client.hot`.
2664
+ * If you want to interact with all environments, loop over `server.environments`.
2665
+ */
2666
+ hot: NormalizedHotChannel;
2667
+ /**
2668
+ * Rollup plugin container that can run plugin hooks on a given file
2669
+ */
2670
+ pluginContainer: PluginContainer;
2671
+ /**
2672
+ * Module execution environments attached to the Vite server.
2673
+ */
2674
+ environments: Record<"client" | "ssr" | (string & {}), DevEnvironment>;
2675
+ /**
2676
+ * Module graph that tracks the import relationships, url to file mapping
2677
+ * and hmr state.
2678
+ */
2679
+ moduleGraph: ModuleGraph;
2680
+ /**
2681
+ * The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
2682
+ * in middleware mode or if the server is not listening on any port.
2683
+ */
2684
+ resolvedUrls: ResolvedServerUrls | null;
2685
+ /**
2686
+ * Programmatically resolve, load and transform a URL and get the result
2687
+ * without going through the http request pipeline.
2688
+ */
2689
+ transformRequest(url: string, options?: TransformOptions): Promise<TransformResult | null>;
2690
+ /**
2691
+ * Same as `transformRequest` but only warm up the URLs so the next request
2692
+ * will already be cached. The function will never throw as it handles and
2693
+ * reports errors internally.
2694
+ */
2695
+ warmupRequest(url: string, options?: TransformOptions): Promise<void>;
2696
+ /**
2697
+ * Apply vite built-in HTML transforms and any plugin HTML transforms.
2698
+ */
2699
+ transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
2700
+ /**
2701
+ * Transform module code into SSR format.
2702
+ */
2703
+ ssrTransform(code: string, inMap: SourceMap | {
2704
+ mappings: "";
2705
+ } | null, url: string, originalCode?: string): Promise<TransformResult | null>;
2706
+ /**
2707
+ * Load a given URL as an instantiated module for SSR.
2708
+ */
2709
+ ssrLoadModule(url: string, opts?: {
2710
+ fixStacktrace?: boolean;
2711
+ }): Promise<Record<string, any>>;
2712
+ /**
2713
+ * Returns a fixed version of the given stack
2714
+ */
2715
+ ssrRewriteStacktrace(stack: string): string;
2716
+ /**
2717
+ * Mutates the given SSR error by rewriting the stacktrace
2718
+ */
2719
+ ssrFixStacktrace(e: Error): void;
2720
+ /**
2721
+ * Triggers HMR for a module in the module graph. You can use the `server.moduleGraph`
2722
+ * API to retrieve the module to be reloaded. If `hmr` is false, this is a no-op.
2723
+ */
2724
+ reloadModule(module: ModuleNode): Promise<void>;
2725
+ /**
2726
+ * Start the server.
2727
+ */
2728
+ listen(port?: number, isRestart?: boolean): Promise<ViteDevServer>;
2729
+ /**
2730
+ * Stop the server.
2731
+ */
2732
+ close(): Promise<void>;
2733
+ /**
2734
+ * Print server urls
2735
+ */
2736
+ printUrls(): void;
2737
+ /**
2738
+ * Bind CLI shortcuts
2739
+ */
2740
+ bindCLIShortcuts(options?: BindCLIShortcutsOptions<ViteDevServer>): void;
2741
+ /**
2742
+ * Restart the server.
2743
+ *
2744
+ * @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
2745
+ */
2746
+ restart(forceOptimize?: boolean): Promise<void>;
2747
+ /**
2748
+ * Open browser
2749
+ */
2750
+ openBrowser(): void;
2751
+ /**
2752
+ * Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
2753
+ * are processed. If called from a load or transform plugin hook, the id needs to be
2754
+ * passed as a parameter to avoid deadlocks. Calling this function after the first
2755
+ * static imports section of the module graph has been processed will resolve immediately.
2756
+ */
2757
+ waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
2758
+ }
2759
+ interface ResolvedServerUrls {
2760
+ local: string[];
2761
+ network: string[];
2762
+ }
2763
+ declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Promise<ViteDevServer>;
2764
+ //#endregion
2765
+ //#region src/node/plugins/html.d.ts
2766
+ interface HtmlTagDescriptor {
2767
+ tag: string;
2768
+ /**
2769
+ * attribute values will be escaped automatically if needed
2770
+ */
2771
+ attrs?: Record<string, string | boolean | undefined>;
2772
+ children?: string | HtmlTagDescriptor[];
2773
+ /**
2774
+ * default: 'head-prepend'
2775
+ */
2776
+ injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
2777
+ }
2778
+ type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
2779
+ html: string;
2780
+ tags: HtmlTagDescriptor[];
2781
+ };
2782
+ interface IndexHtmlTransformContext {
2783
+ /**
2784
+ * public path when served
2785
+ */
2786
+ path: string;
2787
+ /**
2788
+ * filename on disk
2789
+ */
2790
+ filename: string;
2791
+ server?: ViteDevServer;
2792
+ bundle?: OutputBundle;
2793
+ chunk?: OutputChunk;
2794
+ originalUrl?: string;
2795
+ }
2796
+ type IndexHtmlTransformHook = (this: MinimalPluginContextWithoutEnvironment, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
2797
+ type IndexHtmlTransform = IndexHtmlTransformHook | {
2798
+ order?: "pre" | "post" | null;
2799
+ handler: IndexHtmlTransformHook;
2800
+ };
2801
+ //#endregion
2802
+ //#region src/node/plugins/pluginFilter.d.ts
2803
+ type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
2804
+ include?: Value | Array<Value>;
2805
+ exclude?: Value | Array<Value>;
2806
+ };
2807
+ //#endregion
2808
+ //#region src/node/plugin.d.ts
2809
+ /**
2810
+ * Vite plugins extends the Rollup plugin interface with a few extra
2811
+ * vite-specific options. A valid vite plugin is also a valid Rollup plugin.
2812
+ * On the contrary, a Rollup plugin may or may NOT be a valid vite universal
2813
+ * plugin, since some Rollup features do not make sense in an unbundled
2814
+ * dev server context. That said, as long as a rollup plugin doesn't have strong
2815
+ * coupling between its bundle phase and output phase hooks then it should
2816
+ * just work (that means, most of them).
2817
+ *
2818
+ * By default, the plugins are run during both serve and build. When a plugin
2819
+ * is applied during serve, it will only run **non output plugin hooks** (see
2820
+ * rollup type definition of {@link rollup#PluginHooks}). You can think of the
2821
+ * dev server as only running `const bundle = rollup.rollup()` but never calling
2822
+ * `bundle.generate()`.
2823
+ *
2824
+ * A plugin that expects to have different behavior depending on serve/build can
2825
+ * export a factory function that receives the command being run via options.
2826
+ *
2827
+ * If a plugin should be applied only for server or build, a function format
2828
+ * config file can be used to conditional determine the plugins to use.
2829
+ *
2830
+ * The current environment can be accessed from the context for the all non-global
2831
+ * hooks (it is not available in config, configResolved, configureServer, etc).
2832
+ * It can be a dev, build, or scan environment.
2833
+ * Plugins can use this.environment.mode === 'dev' to guard for dev specific APIs.
2834
+ */
2835
+ interface PluginContextExtension {
2836
+ /**
2837
+ * Vite-specific environment instance
2838
+ */
2839
+ environment: Environment;
2840
+ }
2841
+ interface PluginContextMetaExtension {
2842
+ viteVersion: string;
2843
+ }
2844
+ interface ConfigPluginContext extends Omit<MinimalPluginContext, "meta" | "environment"> {
2845
+ meta: Omit<PluginContextMeta, "watchMode">;
2846
+ }
2847
+ interface MinimalPluginContextWithoutEnvironment extends Omit<MinimalPluginContext, "environment"> {}
2848
+ declare module "rolldown" {
2849
+ interface MinimalPluginContext extends PluginContextExtension {}
2850
+ interface PluginContextMeta extends PluginContextMetaExtension {}
2851
+ }
2852
+ /**
2853
+ * There are two types of plugins in Vite. App plugins and environment plugins.
2854
+ * Environment Plugins are defined by a constructor function that will be called
2855
+ * once per each environment allowing users to have completely different plugins
2856
+ * for each of them. The constructor gets the resolved environment after the server
2857
+ * and builder has already been created simplifying config access and cache
2858
+ * management for environment specific plugins.
2859
+ * Environment Plugins are closer to regular rollup plugins. They can't define
2860
+ * app level hooks (like config, configResolved, configureServer, etc).
2861
+ */
2862
+ interface Plugin<A = any> extends Rolldown.Plugin<A> {
2863
+ /**
2864
+ * Perform custom handling of HMR updates.
2865
+ * The handler receives an options containing changed filename, timestamp, a
2866
+ * list of modules affected by the file change, and the dev server instance.
2867
+ *
2868
+ * - The hook can return a filtered list of modules to narrow down the update.
2869
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
2870
+ * the descriptors.
2871
+ *
2872
+ * - The hook can also return an empty array and then perform custom updates
2873
+ * by sending a custom hmr payload via environment.hot.send().
2874
+ *
2875
+ * - If the hook doesn't return a value, the hmr update will be performed as
2876
+ * normal.
2877
+ */
2878
+ hotUpdate?: ObjectHook<(this: MinimalPluginContext & {
2879
+ environment: DevEnvironment;
2880
+ }, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>>;
2881
+ /**
2882
+ * extend hooks with ssr flag
2883
+ */
2884
+ resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
2885
+ kind?: ImportKind;
2886
+ custom?: CustomPluginOptions;
2887
+ ssr?: boolean | undefined;
2888
+
2889
+ isEntry: boolean;
2890
+ }) => Promise<ResolveIdResult> | ResolveIdResult, {
2891
+ filter?: {
2892
+ id?: StringFilter<RegExp>;
2893
+ };
2894
+ }>;
2895
+ load?: ObjectHook<(this: PluginContext, id: string, options?: {
2896
+ ssr?: boolean | undefined;
2897
+ }) => Promise<LoadResult> | LoadResult, {
2898
+ filter?: {
2899
+ id?: StringFilter;
2900
+ };
2901
+ }>;
2902
+ transform?: ObjectHook<(this: TransformPluginContext, code: string, id: string, options?: {
2903
+ moduleType: ModuleType;
2904
+ ssr?: boolean | undefined;
2905
+ }) => Promise<Rolldown.TransformResult> | Rolldown.TransformResult, {
2906
+ filter?: {
2907
+ id?: StringFilter;
2908
+ code?: StringFilter;
2909
+ moduleType?: ModuleTypeFilter;
2910
+ };
2911
+ }>;
2912
+ /**
2913
+ * Opt-in this plugin into the shared plugins pipeline.
2914
+ * For backward-compatibility, plugins are re-recreated for each environment
2915
+ * during `vite build --app`
2916
+ * We have an opt-in per plugin, and a general `builder.sharedPlugins`
2917
+ * In a future major, we'll flip the default to be shared by default
2918
+ * @experimental
2919
+ */
2920
+ sharedDuringBuild?: boolean;
2921
+ /**
2922
+ * Opt-in this plugin into per-environment buildStart and buildEnd during dev.
2923
+ * For backward-compatibility, the buildStart hook is called only once during
2924
+ * dev, for the client environment. Plugins can opt-in to be called
2925
+ * per-environment, aligning with the build hook behavior.
2926
+ * @experimental
2927
+ */
2928
+ perEnvironmentStartEndDuringDev?: boolean;
2929
+ /**
2930
+ * Opt-in this plugin into per-environment watchChange during dev.
2931
+ * For backward-compatibility, the watchChange hook is called only once during
2932
+ * dev, for the client environment. Plugins can opt-in to be called
2933
+ * per-environment, aligning with the watchChange hook behavior.
2934
+ * @experimental
2935
+ */
2936
+ perEnvironmentWatchChangeDuringDev?: boolean;
2937
+ /**
2938
+ * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
2939
+ * is still subject to the `order` property in the hook object.
2940
+ *
2941
+ * Plugin invocation order:
2942
+ * - alias resolution
2943
+ * - `enforce: 'pre'` plugins
2944
+ * - vite core plugins
2945
+ * - normal plugins
2946
+ * - vite build plugins
2947
+ * - `enforce: 'post'` plugins
2948
+ * - vite build post plugins
2949
+ */
2950
+ enforce?: "pre" | "post";
2951
+ /**
2952
+ * Apply the plugin only for serve or build, or on certain conditions.
2953
+ */
2954
+ apply?: "serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean);
2955
+ /**
2956
+ * Define environments where this plugin should be active
2957
+ * By default, the plugin is active in all environments
2958
+ * @experimental
2959
+ */
2960
+ applyToEnvironment?: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption;
2961
+ /**
2962
+ * Modify vite config before it's resolved. The hook can either mutate the
2963
+ * passed-in config directly, or return a partial config object that will be
2964
+ * deeply merged into existing config.
2965
+ *
2966
+ * Note: User plugins are resolved before running this hook so injecting other
2967
+ * plugins inside the `config` hook will have no effect.
2968
+ */
2969
+ config?: ObjectHook<(this: ConfigPluginContext, config: UserConfig, env: ConfigEnv) => Omit<UserConfig, "plugins"> | null | void | Promise<Omit<UserConfig, "plugins"> | null | void>>;
2970
+ /**
2971
+ * Modify environment configs before it's resolved. The hook can either mutate the
2972
+ * passed-in environment config directly, or return a partial config object that will be
2973
+ * deeply merged into existing config.
2974
+ * This hook is called for each environment with a partially resolved environment config
2975
+ * that already accounts for the default environment config values set at the root level.
2976
+ * If plugins need to modify the config of a given environment, they should do it in this
2977
+ * hook instead of the config hook. Leaving the config hook only for modifying the root
2978
+ * default environment config.
2979
+ */
2980
+ configEnvironment?: ObjectHook<(this: ConfigPluginContext, name: string, config: EnvironmentOptions, env: ConfigEnv & {
2981
+ /**
2982
+ * Whether this environment is SSR environment and `ssr.target` is set to `'webworker'`.
2983
+ * Only intended to be used for backward compatibility.
2984
+ */
2985
+ isSsrTargetWebworker?: boolean;
2986
+ }) => EnvironmentOptions | null | void | Promise<EnvironmentOptions | null | void>>;
2987
+ /**
2988
+ * Use this hook to read and store the final resolved vite config.
2989
+ */
2990
+ configResolved?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, config: ResolvedConfig) => void | Promise<void>>;
2991
+ /**
2992
+ * Configure the vite server. The hook receives the {@link ViteDevServer}
2993
+ * instance. This can also be used to store a reference to the server
2994
+ * for use in other hooks.
2995
+ *
2996
+ * The hooks will be called before internal middlewares are applied. A hook
2997
+ * can return a post hook that will be called after internal middlewares
2998
+ * are applied. Hook can be async functions and will be called in series.
2999
+ */
3000
+ configureServer?: ObjectHook<ServerHook>;
3001
+ /**
3002
+ * Configure the preview server. The hook receives the {@link PreviewServer}
3003
+ * instance. This can also be used to store a reference to the server
3004
+ * for use in other hooks.
3005
+ *
3006
+ * The hooks are called before other middlewares are applied. A hook can
3007
+ * return a post hook that will be called after other middlewares are
3008
+ * applied. Hooks can be async functions and will be called in series.
3009
+ */
3010
+ configurePreviewServer?: ObjectHook<PreviewServerHook>;
3011
+ /**
3012
+ * Transform index.html.
3013
+ * The hook receives the following arguments:
3014
+ *
3015
+ * - html: string
3016
+ * - ctx: IndexHtmlTransformContext, which contains:
3017
+ * - path: public path when served
3018
+ * - filename: filename on disk
3019
+ * - server?: ViteDevServer (only present during serve)
3020
+ * - bundle?: rollup.OutputBundle (only present during build)
3021
+ * - chunk?: rollup.OutputChunk
3022
+ * - originalUrl?: string
3023
+ *
3024
+ * It can either return a transformed string, or a list of html tag
3025
+ * descriptors that will be injected into the `<head>` or `<body>`.
3026
+ *
3027
+ * By default the transform is applied **after** vite's internal html
3028
+ * transform. If you need to apply the transform before vite, use an object:
3029
+ * `{ order: 'pre', handler: hook }`
3030
+ */
3031
+ transformIndexHtml?: IndexHtmlTransform;
3032
+ /**
3033
+ * Build Environments
3034
+ *
3035
+ * @experimental
3036
+ */
3037
+ buildApp?: ObjectHook<BuildAppHook>;
3038
+ /**
3039
+ * Perform custom handling of HMR updates.
3040
+ * The handler receives a context containing changed filename, timestamp, a
3041
+ * list of modules affected by the file change, and the dev server instance.
3042
+ *
3043
+ * - The hook can return a filtered list of modules to narrow down the update.
3044
+ * e.g. for a Vue SFC, we can narrow down the part to update by comparing
3045
+ * the descriptors.
3046
+ *
3047
+ * - The hook can also return an empty array and then perform custom updates
3048
+ * by sending a custom hmr payload via server.ws.send().
3049
+ *
3050
+ * - If the hook doesn't return a value, the hmr update will be performed as
3051
+ * normal.
3052
+ */
3053
+ handleHotUpdate?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, ctx: HmrContext) => Array<ModuleNode> | void | Promise<Array<ModuleNode> | void>>;
3054
+ /**
3055
+ * This hook is not supported by Rolldown yet. But the type is declared for compatibility.
3056
+ *
3057
+ * @deprecated This hook is **not** deprecated. It is marked as deprecated just to make it clear that this hook is currently a no-op.
3058
+ */
3059
+ shouldTransformCachedModule?: ObjectHook<(this: PluginContext, options: {
3060
+ code: string;
3061
+ id: string;
3062
+ meta: CustomPluginOptions;
3063
+ moduleSideEffects: boolean | "no-treeshake";
3064
+ }) => boolean | null | void>;
3065
+ }
3066
+ type HookHandler<T> = T extends ObjectHook<infer H> ? H : T;
3067
+ type PluginWithRequiredHook<K extends keyof Plugin> = Plugin & { [P in K]: NonNullable<Plugin[P]> };
3068
+ type Thenable<T> = T | Promise<T>;
3069
+ type FalsyPlugin = false | null | undefined;
3070
+ type PluginOption = Thenable<Plugin | {
3071
+ name: string;
3072
+ } | FalsyPlugin | PluginOption[]>;
3073
+ /**
3074
+ * @experimental
3075
+ */
3076
+ declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption): Plugin;
3077
+ //#endregion
3078
+ //#region src/node/idResolver.d.ts
3079
+ type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
3080
+ /**
3081
+ * Create an internal resolver to be used in special scenarios, e.g.
3082
+ * optimizer and handling css @imports
3083
+ */
3084
+ declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
3085
+ //#endregion
3086
+ //#region src/node/plugins/css.d.ts
3087
+ interface CSSOptions {
3088
+ /**
3089
+ * Using lightningcss is an experimental option to handle CSS modules,
3090
+ * assets and imports via Lightning CSS. It requires to install it as a
3091
+ * peer dependency.
3092
+ *
3093
+ * @default 'postcss'
3094
+ * @experimental
3095
+ */
3096
+ transformer?: "postcss" | "lightningcss";
3097
+ /**
3098
+ * https://github.com/css-modules/postcss-modules
3099
+ */
3100
+ modules?: CSSModulesOptions | false;
3101
+ /**
3102
+ * Options for preprocessors.
3103
+ *
3104
+ * In addition to options specific to each processors, Vite supports `additionalData` option.
3105
+ * The `additionalData` option can be used to inject extra code for each style content.
3106
+ */
3107
+ preprocessorOptions?: {
3108
+ scss?: SassPreprocessorOptions;
3109
+ sass?: SassPreprocessorOptions;
3110
+ less?: LessPreprocessorOptions;
3111
+ styl?: StylusPreprocessorOptions;
3112
+ stylus?: StylusPreprocessorOptions;
3113
+ };
3114
+ /**
3115
+ * If this option is set, preprocessors will run in workers when possible.
3116
+ * `true` means the number of CPUs minus 1.
3117
+ *
3118
+ * @default true
3119
+ */
3120
+ preprocessorMaxWorkers?: number | true;
3121
+ postcss?: string | (PostCSS.ProcessOptions & {
3122
+ plugins?: PostCSS.AcceptedPlugin[];
3123
+ });
3124
+ /**
3125
+ * Enables css sourcemaps during dev
3126
+ * @default false
3127
+ * @experimental
3128
+ */
3129
+ devSourcemap?: boolean;
3130
+ /**
3131
+ * @experimental
3132
+ */
3133
+ lightningcss?: lightningcssOptions_LightningCSSOptions;
3134
+ }
3135
+ interface CSSModulesOptions {
3136
+ getJSON?: (cssFileName: string, json: Record<string, string>, outputFileName: string) => void;
3137
+ scopeBehaviour?: "global" | "local";
3138
+ globalModulePaths?: RegExp[];
3139
+ exportGlobals?: boolean;
3140
+ generateScopedName?: string | ((name: string, filename: string, css: string) => string);
3141
+ hashPrefix?: string;
3142
+ /**
3143
+ * default: undefined
3144
+ */
3145
+ localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly" | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
3146
+ }
3147
+ type ResolvedCSSOptions = Omit<CSSOptions, "lightningcss"> & Required<Pick<CSSOptions, "transformer" | "devSourcemap">> & {
3148
+ lightningcss?: lightningcssOptions_LightningCSSOptions;
3149
+ };
3150
+ interface PreprocessCSSResult {
3151
+ code: string;
3152
+ map?: SourceMapInput;
3153
+ modules?: Record<string, string>;
3154
+ deps?: Set<string>;
3155
+ }
3156
+ /**
3157
+ * @experimental
3158
+ */
3159
+ declare function preprocessCSS(code: string, filename: string, config: ResolvedConfig): Promise<PreprocessCSSResult>;
3160
+ declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
3161
+ type PreprocessorAdditionalDataResult = string | {
3162
+ content: string;
3163
+ map?: ExistingRawSourceMap;
3164
+ };
3165
+ type PreprocessorAdditionalData = string | ((source: string, filename: string) => PreprocessorAdditionalDataResult | Promise<PreprocessorAdditionalDataResult>);
3166
+ type SassPreprocessorOptions = {
3167
+ additionalData?: PreprocessorAdditionalData;
3168
+ } & SassModernPreprocessBaseOptions;
3169
+ type LessPreprocessorOptions = {
3170
+ additionalData?: PreprocessorAdditionalData;
3171
+ } & LessPreprocessorBaseOptions;
3172
+ type StylusPreprocessorOptions = {
3173
+ additionalData?: PreprocessorAdditionalData;
3174
+ } & StylusPreprocessorBaseOptions;
3175
+ //#endregion
3176
+ //#region src/node/plugins/esbuild.d.ts
3177
+ interface ESBuildOptions extends esbuildOptions_EsbuildTransformOptions {
3178
+ include?: string | RegExp | ReadonlyArray<string | RegExp>;
3179
+ exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3180
+ jsxInject?: string;
3181
+ /**
3182
+ * This option is not respected. Use `build.minify` instead.
3183
+ */
3184
+ minify?: never;
3185
+ }
3186
+ type ESBuildTransformResult = Omit<EsbuildTransformResult, "map"> & {
3187
+ map: SourceMap;
3188
+ };
3189
+ declare function transformWithEsbuild(code: string, filename: string, options?: esbuildOptions_EsbuildTransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher, ignoreEsbuildWarning?: boolean): Promise<ESBuildTransformResult>;
3190
+ //#endregion
3191
+ //#region src/node/plugins/json.d.ts
3192
+ interface JsonOptions {
3193
+ /**
3194
+ * Generate a named export for every property of the JSON object
3195
+ * @default true
3196
+ */
3197
+ namedExports?: boolean;
3198
+ /**
3199
+ * Generate performant output as JSON.parse("stringified").
3200
+ *
3201
+ * When set to 'auto', the data will be stringified only if the data is bigger than 10kB.
3202
+ * @default 'auto'
3203
+ */
3204
+ stringify?: boolean | "auto";
3205
+ }
3206
+ //#endregion
3207
+ //#region src/node/assetSource.d.ts
3208
+ /**
3209
+ * Defines which attributes of an HTML element should be treated as asset sources.
3210
+ * Used in `html.additionalAssetSources` configuration.
3211
+ */
3212
+ interface HtmlAssetSource {
3213
+ /**
3214
+ * Attributes that contain a single asset URL.
3215
+ * @example ['src', 'data-src-dark']
3216
+ */
3217
+ srcAttributes?: string[];
3218
+ /**
3219
+ * Attributes that contain srcset-format URLs.
3220
+ * @example ['srcset', 'imagesrcset']
3221
+ */
3222
+ srcsetAttributes?: string[];
3223
+ /**
3224
+ * Called before handling an attribute to determine if it should be processed.
3225
+ */
3226
+ filter?: (data: HtmlAssetSourceFilterData) => boolean;
3227
+ }
3228
+ interface HtmlAssetSourceFilterData {
3229
+ key: string;
3230
+ value: string;
3231
+ attributes: Record<string, string>;
3232
+ }
3233
+ //#endregion
3234
+ //#region src/node/ssr/index.d.ts
3235
+ type SSRTarget = "node" | "webworker";
3236
+ type SsrDepOptimizationConfig = DepOptimizationConfig;
3237
+ interface SSROptions {
3238
+ noExternal?: string | RegExp | (string | RegExp)[] | true;
3239
+ external?: string[] | true;
3240
+ /**
3241
+ * Define the target for the ssr build. The browser field in package.json
3242
+ * is ignored for node but used if webworker is the target
3243
+ * This option will be removed in a future major version
3244
+ * @default 'node'
3245
+ */
3246
+ target?: SSRTarget;
3247
+ /**
3248
+ * Control over which dependencies are optimized during SSR and esbuild options
3249
+ * During build:
3250
+ * no external CJS dependencies are optimized by default
3251
+ * During dev:
3252
+ * explicit no external CJS dependencies are optimized by default
3253
+ * @experimental
3254
+ */
3255
+ optimizeDeps?: SsrDepOptimizationConfig;
3256
+ resolve?: {
3257
+ /**
3258
+ * Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
3259
+ *
3260
+ * Use this to override the default ssr conditions for the ssr build.
3261
+ *
3262
+ * @default rootConfig.resolve.conditions
3263
+ */
3264
+ conditions?: string[];
3265
+ /**
3266
+ * Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
3267
+ *
3268
+ * @default ['node', 'module-sync']
3269
+ */
3270
+ externalConditions?: string[];
3271
+ mainFields?: string[];
3272
+ };
3273
+ }
3274
+ interface ResolvedSSROptions extends SSROptions {
3275
+ target: SSRTarget;
3276
+ optimizeDeps: SsrDepOptimizationConfig;
3277
+ }
3278
+ //#endregion
3279
+ //#region src/node/plugins/oxc.d.ts
3280
+ interface OxcOptions extends Omit<rolldown_utils_TransformOptions, "cwd" | "sourceType" | "lang" | "sourcemap" | "helpers" | "inject" | "tsconfig" | "inputMap"> {
3281
+ include?: string | RegExp | ReadonlyArray<string | RegExp>;
3282
+ exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3283
+ jsxInject?: string;
3284
+ jsxRefreshInclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3285
+ jsxRefreshExclude?: string | RegExp | ReadonlyArray<string | RegExp>;
3286
+ }
3287
+ declare function transformWithOxc(code: string, filename: string, options?: rolldown_utils_TransformOptions, inMap?: object, config?: ResolvedConfig, watcher?: FSWatcher): Promise<Omit<rolldown_utils_TransformResult, "errors">>;
3288
+ //#endregion
3289
+ //#region src/node/config.d.ts
3290
+ interface ConfigEnv {
3291
+ /**
3292
+ * 'serve': during dev (`vite` command)
3293
+ * 'build': when building for production (`vite build` command)
3294
+ */
3295
+ command: "build" | "serve";
3296
+ mode: string;
3297
+ isSsrBuild?: boolean;
3298
+ isPreview?: boolean;
3299
+ }
3300
+ /**
3301
+ * spa: include SPA fallback middleware and configure sirv with `single: true` in preview
3302
+ *
3303
+ * mpa: only include non-SPA HTML middlewares
3304
+ *
3305
+ * custom: don't include HTML middlewares
3306
+ */
3307
+ type AppType = "spa" | "mpa" | "custom";
3308
+ type UserConfigFnObject = (env: ConfigEnv) => UserConfig;
3309
+ type UserConfigFnPromise = (env: ConfigEnv) => Promise<UserConfig>;
3310
+ type UserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>;
3311
+ type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
3312
+ /**
3313
+ * Type helper to make it easier to use vite.config.ts
3314
+ * accepts a direct {@link UserConfig} object, or a function that returns it.
3315
+ * The function receives a {@link ConfigEnv} object.
3316
+ */
3317
+ declare function defineConfig(config: UserConfig): UserConfig;
3318
+ declare function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;
3319
+ declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
3320
+ declare function defineConfig(config: UserConfigFnPromise): UserConfigFnPromise;
3321
+ declare function defineConfig(config: UserConfigFn): UserConfigFn;
3322
+ declare function defineConfig(config: UserConfigExport): UserConfigExport;
3323
+ interface CreateDevEnvironmentContext {
3324
+ ws: WebSocketServer;
3325
+ }
3326
+ interface DevEnvironmentOptions {
3327
+ /**
3328
+ * Files to be pre-transformed. Supports glob patterns.
3329
+ */
3330
+ warmup?: string[];
3331
+ /**
3332
+ * Pre-transform known direct imports
3333
+ * defaults to true for the client environment, false for the rest
3334
+ */
3335
+ preTransformRequests?: boolean;
3336
+ /**
3337
+ * Enables sourcemaps during dev
3338
+ * @default { js: true }
3339
+ * @experimental
3340
+ */
3341
+ sourcemap?: boolean | {
3342
+ js?: boolean;
3343
+ css?: boolean;
3344
+ };
3345
+ /**
3346
+ * Whether or not to ignore-list source files in the dev server sourcemap, used to populate
3347
+ * the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
3348
+ *
3349
+ * By default, it excludes all paths containing `node_modules`. You can pass `false` to
3350
+ * disable this behavior, or, for full control, a function that takes the source path and
3351
+ * sourcemap path and returns whether to ignore the source path.
3352
+ */
3353
+ sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
3354
+ /**
3355
+ * create the Dev Environment instance
3356
+ */
3357
+ createEnvironment?: (name: string, config: ResolvedConfig, context: CreateDevEnvironmentContext) => Promise<DevEnvironment> | DevEnvironment;
3358
+ /**
3359
+ * For environments that support a full-reload, like the client, we can short-circuit when
3360
+ * restarting the server throwing early to stop processing current files. We avoided this for
3361
+ * SSR requests. Maybe this is no longer needed.
3362
+ * @experimental
3363
+ */
3364
+ recoverable?: boolean;
3365
+ /**
3366
+ * For environments associated with a module runner.
3367
+ * By default, it is false for the client environment and true for non-client environments.
3368
+ * This option can also be used instead of the removed config.experimental.skipSsrTransform.
3369
+ */
3370
+ moduleRunnerTransform?: boolean;
3371
+ }
3372
+ type ResolvedDevEnvironmentOptions = Omit<Required<DevEnvironmentOptions>, "sourcemapIgnoreList"> & {
3373
+ sourcemapIgnoreList: Exclude<DevEnvironmentOptions["sourcemapIgnoreList"], false | undefined>;
3374
+ };
3375
+ type AllResolveOptions = ResolveOptions & {
3376
+ alias?: AliasOptions;
3377
+ };
3378
+ interface SharedEnvironmentOptions {
3379
+ /**
3380
+ * Define global variable replacements.
3381
+ * Entries will be defined on `window` during dev and replaced during build.
3382
+ */
3383
+ define?: Record<string, any>;
3384
+ /**
3385
+ * Configure resolver
3386
+ */
3387
+ resolve?: EnvironmentResolveOptions;
3388
+ /**
3389
+ * Define if this environment is used for Server-Side Rendering
3390
+ * @default 'server' if it isn't the client environment
3391
+ */
3392
+ consumer?: "client" | "server";
3393
+ /**
3394
+ * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
3395
+ * Otherwise, it is statically replaced as an empty object.
3396
+ */
3397
+ keepProcessEnv?: boolean;
3398
+ /**
3399
+ * Optimize deps config
3400
+ */
3401
+ optimizeDeps?: DepOptimizationOptions;
3402
+ /**
3403
+ * Whether this environment produces a bundled output.
3404
+ *
3405
+ * During `build`, this defaults to `true` for every environment.
3406
+ * During `serve`, this defaults to `true` only for the client environment
3407
+ * when `experimental.bundledDev` is enabled, and `false` otherwise.
3408
+ * Setting this explicitly on an environment always overrides the default.
3409
+ *
3410
+ * @experimental
3411
+ */
3412
+ isBundled?: boolean;
3413
+ }
3414
+ interface EnvironmentOptions extends SharedEnvironmentOptions {
3415
+ /**
3416
+ * Dev specific options
3417
+ */
3418
+ dev?: DevEnvironmentOptions;
3419
+ /**
3420
+ * Build specific options
3421
+ */
3422
+ build?: BuildEnvironmentOptions;
3423
+ }
3424
+ type ResolvedResolveOptions = Required<ResolveOptions>;
3425
+ type ResolvedEnvironmentOptions = {
3426
+ define?: Record<string, any>;
3427
+ resolve: ResolvedResolveOptions;
3428
+ consumer: "client" | "server";
3429
+ keepProcessEnv?: boolean;
3430
+ optimizeDeps: DepOptimizationOptions;
3431
+ dev: ResolvedDevEnvironmentOptions;
3432
+ build: ResolvedBuildEnvironmentOptions;
3433
+ isBundled: boolean;
3434
+ plugins: readonly Plugin[];
3435
+ };
3436
+ type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve" | "keepProcessEnv"> & {
3437
+ resolve?: AllResolveOptions;
3438
+ };
3439
+ interface UserConfig extends DefaultEnvironmentOptions {
3440
+ /**
3441
+ * Project root directory. Can be an absolute path, or a path relative from
3442
+ * the location of the config file itself.
3443
+ * @default process.cwd()
3444
+ */
3445
+ root?: string;
3446
+ /**
3447
+ * Base public path when served in development or production.
3448
+ * @default '/'
3449
+ */
3450
+ base?: string;
3451
+ /**
3452
+ * Directory to serve as plain static assets. Files in this directory are
3453
+ * served and copied to build dist dir as-is without transform. The value
3454
+ * can be either an absolute file system path or a path relative to project root.
3455
+ *
3456
+ * Set to `false` or an empty string to disable copied static assets to build dist dir.
3457
+ * @default 'public'
3458
+ */
3459
+ publicDir?: string | false;
3460
+ /**
3461
+ * Directory to save cache files. Files in this directory are pre-bundled
3462
+ * deps or some other cache files that generated by vite, which can improve
3463
+ * the performance. You can use `--force` flag or manually delete the directory
3464
+ * to regenerate the cache files. The value can be either an absolute file
3465
+ * system path or a path relative to project root.
3466
+ * Default to `.vite` when no `package.json` is detected.
3467
+ * @default 'node_modules/.vite'
3468
+ */
3469
+ cacheDir?: string;
3470
+ /**
3471
+ * Explicitly set a mode to run in. This will override the default mode for
3472
+ * each command, and can be overridden by the command line --mode option.
3473
+ */
3474
+ mode?: string;
3475
+ /**
3476
+ * Array of vite plugins to use.
3477
+ */
3478
+ plugins?: PluginOption[];
3479
+ /**
3480
+ * HTML related options
3481
+ */
3482
+ html?: HTMLOptions;
3483
+ /**
3484
+ * CSS related options (preprocessors and CSS modules)
3485
+ */
3486
+ css?: CSSOptions;
3487
+ /**
3488
+ * JSON loading options
3489
+ */
3490
+ json?: JsonOptions;
3491
+ /**
3492
+ * Transform options to pass to esbuild.
3493
+ * Or set to `false` to disable esbuild.
3494
+ *
3495
+ * @deprecated Use `oxc` option instead.
3496
+ */
3497
+ esbuild?: ESBuildOptions | false;
3498
+ /**
3499
+ * Transform options to pass to Oxc.
3500
+ * Or set to `false` to disable Oxc.
3501
+ */
3502
+ oxc?: OxcOptions | false;
3503
+ /**
3504
+ * Specify additional picomatch patterns to be treated as static assets.
3505
+ */
3506
+ assetsInclude?: string | RegExp | (string | RegExp)[];
3507
+ /**
3508
+ * Builder specific options
3509
+ * @experimental
3510
+ */
3511
+ builder?: BuilderOptions;
3512
+ /**
3513
+ * Server specific options, e.g. host, port, https...
3514
+ */
3515
+ server?: ServerOptions$1;
3516
+ /**
3517
+ * Preview specific options, e.g. host, port, https...
3518
+ */
3519
+ preview?: PreviewOptions;
3520
+ /**
3521
+ * Experimental features
3522
+ *
3523
+ * Features under this field could change in the future and might NOT follow semver.
3524
+ * Please be careful and always pin Vite's version when using them.
3525
+ * @experimental
3526
+ */
3527
+ experimental?: ExperimentalOptions;
3528
+ /**
3529
+ * Options to opt-in to future behavior
3530
+ */
3531
+ future?: FutureOptions | "warn";
3532
+ /**
3533
+ * Legacy options
3534
+ *
3535
+ * Features under this field only follow semver for patches, they could be removed in a
3536
+ * future minor version. Please always pin Vite's version to a minor when using them.
3537
+ */
3538
+ legacy?: LegacyOptions;
3539
+ /**
3540
+ * Log level.
3541
+ * @default 'info'
3542
+ */
3543
+ logLevel?: LogLevel;
3544
+ /**
3545
+ * Custom logger.
3546
+ */
3547
+ customLogger?: Logger;
3548
+ /**
3549
+ * @default true
3550
+ */
3551
+ clearScreen?: boolean;
3552
+ /**
3553
+ * Environment files directory. Can be an absolute path, or a path relative from
3554
+ * root.
3555
+ * @default root
3556
+ */
3557
+ envDir?: string | false;
3558
+ /**
3559
+ * Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
3560
+ * @default 'VITE_'
3561
+ */
3562
+ envPrefix?: string | string[];
3563
+ /**
3564
+ * Worker bundle options
3565
+ */
3566
+ worker?: {
3567
+ /**
3568
+ * Output format for worker bundle
3569
+ * @default 'iife'
3570
+ */
3571
+ format?: "es" | "iife";
3572
+ /**
3573
+ * Vite plugins that apply to worker bundle. The plugins returned by this function
3574
+ * should be new instances every time it is called, because they are used for each
3575
+ * rolldown worker bundling process.
3576
+ */
3577
+ plugins?: () => PluginOption[];
3578
+ /**
3579
+ * Alias to `rolldownOptions`.
3580
+ * @deprecated Use `rolldownOptions` instead.
3581
+ */
3582
+ rollupOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3583
+ /**
3584
+ * Rolldown options to build worker bundle
3585
+ */
3586
+ rolldownOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
3587
+ };
3588
+ /**
3589
+ * Dep optimization options
3590
+ */
3591
+ optimizeDeps?: DepOptimizationOptions;
3592
+ /**
3593
+ * SSR specific options
3594
+ * We could make SSROptions be a EnvironmentOptions if we can abstract
3595
+ * external/noExternal for environments in general.
3596
+ */
3597
+ ssr?: SSROptions;
3598
+ /**
3599
+ * Environment overrides
3600
+ */
3601
+ environments?: Record<string, EnvironmentOptions>;
3602
+ /**
3603
+ * Whether your application is a Single Page Application (SPA),
3604
+ * a Multi-Page Application (MPA), or Custom Application (SSR
3605
+ * and frameworks with custom HTML handling)
3606
+ * @default 'spa'
3607
+ */
3608
+ appType?: AppType;
3609
+ /**
3610
+ * Enable devtools integration. Ensure that `@vitejs/devtools` is installed as a dependency.
3611
+ * This feature is currently supported only in build mode.
3612
+ * @experimental
3613
+ * @default false
3614
+ */
3615
+ devtools?: boolean | DevToolsConfig;
3616
+ }
3617
+ interface HTMLOptions {
3618
+ /**
3619
+ * A nonce value placeholder that will be used when generating script/style tags.
3620
+ *
3621
+ * Make sure that this placeholder will be replaced with a unique value for each request by the server.
3622
+ */
3623
+ cspNonce?: string;
3624
+ /**
3625
+ * Define additional HTML elements and attributes to be treated as asset sources.
3626
+ * This extends the built-in list that includes standard elements like `<img src>`, `<video src>`, etc.
3627
+ *
3628
+ * @example
3629
+ * ```ts
3630
+ * html: {
3631
+ * additionalAssetSources: {
3632
+ * // Custom web component
3633
+ * 'html-import': { srcAttributes: ['src'] },
3634
+ * // Add data-* attributes to existing element
3635
+ * 'img': { srcAttributes: ['data-src-dark', 'data-src-light'] }
3636
+ * }
3637
+ * }
3638
+ * ```
3639
+ */
3640
+ additionalAssetSources?: Record<string, HtmlAssetSource>;
3641
+ }
3642
+ interface FutureOptions {
3643
+ removePluginHookHandleHotUpdate?: "warn";
3644
+ removePluginHookSsrArgument?: "warn";
3645
+ removeServerModuleGraph?: "warn";
3646
+ removeServerReloadModule?: "warn";
3647
+ removeServerPluginContainer?: "warn";
3648
+ removeServerHot?: "warn";
3649
+ removeServerTransformRequest?: "warn";
3650
+ removeServerWarmupRequest?: "warn";
3651
+ removeSsrLoadModule?: "warn";
3652
+ }
3653
+ interface ExperimentalOptions {
3654
+ /**
3655
+ * Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
3656
+ *
3657
+ * @experimental
3658
+ * @default false
3659
+ */
3660
+ importGlobRestoreExtension?: boolean;
3661
+ /**
3662
+ * Allow finegrain control over assets and public files paths
3663
+ *
3664
+ * @experimental
3665
+ */
3666
+ renderBuiltUrl?: RenderBuiltAssetUrl;
3667
+ /**
3668
+ * Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
3669
+ *
3670
+ * @experimental
3671
+ * @default false
3672
+ */
3673
+ hmrPartialAccept?: boolean;
3674
+ /**
3675
+ * Enable full bundle mode during `serve`.
3676
+ *
3677
+ * This seeds the default for the client environment's `isBundled` option.
3678
+ * Other environments default to `false` during `serve`. Any environment
3679
+ * can override its `isBundled` value via `environments[name].isBundled`.
3680
+ *
3681
+ * This is highly experimental.
3682
+ *
3683
+ * @experimental
3684
+ * @default false
3685
+ */
3686
+ bundledDev?: boolean;
3687
+ }
3688
+ interface LegacyOptions {
3689
+ /**
3690
+ * In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
3691
+ * that could be exploited by a malicious web page.
3692
+ *
3693
+ * In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
3694
+ * But this may break some plugins and frameworks that connects to the WebSocket server
3695
+ * on their own. Enabling this option will make Vite skip the token check.
3696
+ *
3697
+ * **We do not recommend enabling this option unless you are sure that you are fine with
3698
+ * that security weakness.**
3699
+ */
3700
+ skipWebSocketTokenCheck?: boolean;
3701
+ /**
3702
+ * Opt-in to the pre-Vite 8 CJS interop behavior, which was inconsistent.
3703
+ *
3704
+ * In pre-Vite 8 versions, Vite had inconsistent CJS interop behavior. This was due to
3705
+ * the different behavior of esbuild and the Rollup commonjs plugin.
3706
+ * Vite 8+ uses Rolldown for both the dependency optimization in dev and the production build,
3707
+ * which aligns the behavior to esbuild.
3708
+ *
3709
+ * See the Vite 8 migration guide for more details.
3710
+ */
3711
+ inconsistentCjsInterop?: boolean;
3712
+ }
3713
+ interface ResolvedWorkerOptions {
3714
+ format: "es" | "iife";
3715
+ plugins: (bundleChain: string[]) => Promise<ResolvedConfig>;
3716
+ /**
3717
+ * @deprecated Use `rolldownOptions` instead.
3718
+ */
3719
+ rollupOptions: RolldownOptions;
3720
+ rolldownOptions: RolldownOptions;
3721
+ }
3722
+ interface InlineConfig extends UserConfig {
3723
+ configFile?: string | false;
3724
+ /** @experimental */
3725
+ configLoader?: "bundle" | "runner" | "native";
3726
+ /** @deprecated */
3727
+ envFile?: false;
3728
+ forceOptimizeDeps?: boolean;
3729
+ }
3730
+ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "json" | "assetsInclude" | "optimizeDeps" | "worker" | "build" | "dev" | "environments" | "experimental" | "future" | "server" | "preview" | "devtools"> & {
3731
+ configFile: string | undefined;
3732
+ configFileDependencies: string[];
3733
+ inlineConfig: InlineConfig;
3734
+ root: string;
3735
+ base: string;
3736
+ publicDir: string;
3737
+ cacheDir: string;
3738
+ command: "build" | "serve";
3739
+ mode: string;
3740
+ isWorker: boolean;
3741
+ isProduction: boolean;
3742
+ envDir: string | false;
3743
+ env: Record<string, any>;
3744
+ resolve: Required<ResolveOptions> & {
3745
+ alias: Alias[];
3746
+ };
3747
+ plugins: readonly Plugin[];
3748
+ css: ResolvedCSSOptions;
3749
+ json: Required<JsonOptions>; /** @deprecated Use `oxc` option instead. */
3750
+ esbuild: ESBuildOptions | false;
3751
+ oxc: OxcOptions | false;
3752
+ server: ResolvedServerOptions;
3753
+ dev: ResolvedDevEnvironmentOptions; /** @experimental */
3754
+ builder: ResolvedBuilderOptions | undefined;
3755
+ build: ResolvedBuildOptions;
3756
+ devtools: ResolvedDevToolsConfig;
3757
+ preview: ResolvedPreviewOptions;
3758
+ ssr: ResolvedSSROptions;
3759
+ assetsInclude: (file: string) => boolean;
3760
+ rawAssetsInclude: (string | RegExp)[];
3761
+ logger: Logger;
3762
+ /**
3763
+ * Create an internal resolver to be used in special scenarios, e.g.
3764
+ * optimizer & handling css `@imports`.
3765
+ *
3766
+ * This API is deprecated. It only works for the client and ssr
3767
+ * environments. The `aliasOnly` option is also not being used anymore.
3768
+ * Plugins should move to `createIdResolver(environment.config)` instead.
3769
+ *
3770
+ * @deprecated Use `createIdResolver` from `vite` instead.
3771
+ */
3772
+ createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
3773
+ optimizeDeps: DepOptimizationOptions;
3774
+ worker: ResolvedWorkerOptions;
3775
+ appType: AppType;
3776
+ experimental: RequiredExceptFor<ExperimentalOptions, "renderBuiltUrl">;
3777
+ future: FutureOptions | undefined;
3778
+ environments: Record<string, ResolvedEnvironmentOptions>;
3779
+ /**
3780
+ * The token to connect to the WebSocket server from browsers.
3781
+ *
3782
+ * We recommend using `import.meta.hot` rather than connecting
3783
+ * to the WebSocket server directly.
3784
+ * If you have a usecase that requires connecting to the WebSocket
3785
+ * server, please create an issue so that we can discuss.
3786
+ *
3787
+ * @deprecated
3788
+ */
3789
+ webSocketToken: string;
3790
+ } & PluginHookUtils> {}
3791
+ interface PluginHookUtils {
3792
+ getSortedPlugins: <K extends keyof Plugin>(hookName: K) => PluginWithRequiredHook<K>[];
3793
+ getSortedPluginHooks: <K extends keyof Plugin>(hookName: K) => NonNullable<HookHandler<Plugin[K]>>[];
3794
+ }
3795
+ type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
3796
+ declare function resolveConfig(inlineConfig: InlineConfig, command: "build" | "serve", defaultMode?: string, defaultNodeEnv?: string, isPreview?: boolean, patchConfig?: ((config: ResolvedConfig) => void) | undefined, patchPlugins?: ((resolvedPlugins: Plugin[]) => void) | undefined): Promise<ResolvedConfig>;
3797
+ declare function sortUserPlugins(plugins: (Plugin | Plugin[])[] | undefined): [Plugin[], Plugin[], Plugin[]];
3798
+ declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, configRoot?: string, logLevel?: LogLevel, customLogger?: Logger, configLoader?: "bundle" | "runner" | "native"): Promise<{
3799
+ path: string;
3800
+ config: UserConfig;
3801
+ dependencies: string[];
3802
+ } | null>;
3803
+ //#endregion
3804
+ //#region src/node/server/middlewares/error.d.ts
3805
+ declare function buildErrorMessage(err: RollupError, args?: string[], includeStack?: boolean): string;
3806
+ //#endregion
3807
+ //#region src/node/ssr/runtime/serverModuleRunner.d.ts
3808
+ /**
3809
+ * @experimental
3810
+ */
3811
+ interface ServerModuleRunnerOptions extends Omit<ModuleRunnerOptions, "root" | "fetchModule" | "hmr" | "transport"> {
3812
+ /**
3813
+ * Disable HMR or configure HMR logger.
3814
+ */
3815
+ hmr?: false | {
3816
+ logger?: ModuleRunnerHmr["logger"];
3817
+ };
3818
+ /**
3819
+ * Provide a custom module evaluator. This controls how the code is executed.
3820
+ */
3821
+ evaluator?: ModuleEvaluator;
3822
+ }
3823
+ declare const createServerModuleRunnerTransport: (options: {
3824
+ channel: NormalizedServerHotChannel;
3825
+ }) => ModuleRunnerTransport;
3826
+ /**
3827
+ * Create an instance of the Vite SSR runtime that support HMR.
3828
+ * @experimental
3829
+ */
3830
+ declare function createServerModuleRunner(environment: DevEnvironment, options?: ServerModuleRunnerOptions): ModuleRunner;
3831
+ //#endregion
3832
+ //#region src/node/server/environments/runnableEnvironment.d.ts
3833
+ declare function createRunnableDevEnvironment(name: string, config: ResolvedConfig, context?: RunnableDevEnvironmentContext): RunnableDevEnvironment;
3834
+ interface RunnableDevEnvironmentContext extends Omit<DevEnvironmentContext, "hot"> {
3835
+ runner?: (environment: RunnableDevEnvironment, options?: ServerModuleRunnerOptions) => ModuleRunner;
3836
+ runnerOptions?: ServerModuleRunnerOptions;
3837
+ hot?: boolean;
3838
+ }
3839
+ declare function isRunnableDevEnvironment(environment: Environment): environment is RunnableDevEnvironment;
3840
+ declare class RunnableDevEnvironment extends DevEnvironment {
3841
+ private _runner;
3842
+ private _runnerFactory;
3843
+ private _runnerOptions;
3844
+ constructor(name: string, config: ResolvedConfig, context: RunnableDevEnvironmentContext);
3845
+ get runner(): ModuleRunner;
3846
+ override close(): Promise<void>;
3847
+ }
3848
+ //#endregion
3849
+ //#region src/node/server/environments/fetchableEnvironments.d.ts
3850
+ interface FetchableDevEnvironmentContext extends DevEnvironmentContext {
3851
+ handleRequest(request: Request): Promise<Response> | Response;
3852
+ }
3853
+ declare function createFetchableDevEnvironment(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext): FetchableDevEnvironment;
3854
+ declare function isFetchableDevEnvironment(environment: Environment): environment is FetchableDevEnvironment;
3855
+ declare class FetchableDevEnvironment extends DevEnvironment {
3856
+ private _handleRequest;
3857
+ constructor(name: string, config: ResolvedConfig, context: FetchableDevEnvironmentContext);
3858
+ dispatchFetch(request: Request): Promise<Response>;
3859
+ }
3860
+ //#endregion
3861
+ //#region src/node/ssr/runnerImport.d.ts
3862
+ interface RunnerImportResult<T> {
3863
+ module: T;
3864
+ dependencies: string[];
3865
+ }
3866
+ /**
3867
+ * Import any file using the default Vite environment.
3868
+ * @experimental
3869
+ */
3870
+ declare function runnerImport<T>(moduleId: string, inlineConfig?: InlineConfig): Promise<RunnerImportResult<T>>;
3871
+ //#endregion
3872
+ //#region src/node/ssr/fetchModule.d.ts
3873
+ interface FetchModuleOptions {
3874
+ cached?: boolean;
3875
+ inlineSourceMap?: boolean;
3876
+ startOffset?: number;
3877
+ }
3878
+ /**
3879
+ * Fetch module information for Vite module runner.
3880
+ * @experimental
3881
+ */
3882
+ declare function fetchModule(environment: DevEnvironment, url: string, importer?: string, options?: FetchModuleOptions): Promise<moduleRunner_FetchResult>;
3883
+ //#endregion
3884
+ //#region src/node/ssr/ssrTransform.d.ts
3885
+ interface ModuleRunnerTransformOptions {
3886
+ json?: {
3887
+ stringify?: boolean;
3888
+ };
3889
+ }
3890
+ declare function ssrTransform(code: string, inMap: SourceMap | {
3891
+ mappings: "";
3892
+ } | null, url: string, originalCode: string, options?: ModuleRunnerTransformOptions): Promise<TransformResult | null>;
3893
+ //#endregion
3894
+ //#region src/node/constants.d.ts
3895
+ declare const VERSION: string;
3896
+ declare const DEFAULT_CLIENT_MAIN_FIELDS: readonly string[];
3897
+ declare const DEFAULT_SERVER_MAIN_FIELDS: readonly string[];
3898
+ declare const DEFAULT_CLIENT_CONDITIONS: readonly string[];
3899
+ declare const DEFAULT_SERVER_CONDITIONS: readonly string[];
3900
+ declare const DEFAULT_EXTERNAL_CONDITIONS: readonly string[];
3901
+ declare const defaultAllowedOrigins: RegExp;
3902
+ //#endregion
3903
+ //#region src/node/utils.d.ts
3904
+ /**
3905
+ * Inlined to keep `@rollup/pluginutils` in devDependencies
3906
+ */
3907
+ type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
3908
+ declare const createFilter: (include?: FilterPattern, exclude?: FilterPattern, options?: {
3909
+ resolve?: string | false | null;
3910
+ }) => (id: unknown) => boolean;
3911
+ declare const rollupVersion = "4.23.0";
3912
+ declare function normalizePath(id: string): string;
3913
+ declare const isCSSRequest: (request: string) => boolean;
3914
+ declare function mergeConfig<D extends Record<string, any>, O extends Record<string, any>>(defaults: D extends Function ? never : D, overrides: O extends Function ? never : O, isRoot?: boolean): Record<string, any>;
3915
+ declare function mergeAlias(a?: AliasOptions, b?: AliasOptions): AliasOptions | undefined;
3916
+ //#endregion
3917
+ //#region src/node/server/send.d.ts
3918
+ interface SendOptions {
3919
+ etag?: string;
3920
+ cacheControl?: string;
3921
+ headers?: OutgoingHttpHeaders;
3922
+ map?: SourceMap | {
3923
+ mappings: "";
3924
+ } | null;
3925
+ }
3926
+ declare function send(req: http.IncomingMessage, res: ServerResponse, content: string | Buffer, type: string, options: SendOptions): void;
3927
+ //#endregion
3928
+ //#region src/node/server/searchRoot.d.ts
3929
+ /**
3930
+ * Search up for the nearest workspace root
3931
+ */
3932
+ declare function searchForWorkspaceRoot(current: string, root?: string): string;
3933
+ //#endregion
3934
+ //#region src/node/server/middlewares/static.d.ts
3935
+ /**
3936
+ * Check if the url is allowed to be served, via the `server.fs` config.
3937
+ * @deprecated Use the `isFileLoadingAllowed` function instead.
3938
+ */
3939
+ declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
3940
+ declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
3941
+ /**
3942
+ * Warning: parameters are not validated, only works with normalized absolute paths
3943
+ */
3944
+ declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
3945
+ //#endregion
3946
+ //#region src/node/env.d.ts
3947
+ /**
3948
+ * Load `.env` files within the `envDir` and merge them with the matching
3949
+ * variables already present in `process.env`.
3950
+ */
3951
+ declare function loadEnv(mode: string, envDir: string | false, prefixes?: string | string[]): Record<string, string>;
3952
+ declare function resolveEnvPrefix({
3953
+ envPrefix
3954
+ }: UserConfig): string[];
3955
+ //#endregion
3956
+ //#region src/node/plugins/manifest.d.ts
3957
+ type Manifest = Record<string, ManifestChunk>;
3958
+ interface ManifestChunk {
3959
+ /**
3960
+ * The input file name of this chunk / asset if known
3961
+ */
3962
+ src?: string;
3963
+ /**
3964
+ * The output file name of this chunk / asset
3965
+ */
3966
+ file: string;
3967
+ /**
3968
+ * The list of CSS files imported by this chunk
3969
+ */
3970
+ css?: string[];
3971
+ /**
3972
+ * The list of asset files imported by this chunk, excluding CSS files
3973
+ */
3974
+ assets?: string[];
3975
+ /**
3976
+ * Whether this chunk or asset is an entry point
3977
+ */
3978
+ isEntry?: boolean;
3979
+ /**
3980
+ * The name of this chunk / asset if known
3981
+ */
3982
+ name?: string;
3983
+ /**
3984
+ * Whether this chunk is a dynamic entry point
3985
+ *
3986
+ * This field is only present in JS chunks.
3987
+ */
3988
+ isDynamicEntry?: boolean;
3989
+ /**
3990
+ * The list of statically imported chunks by this chunk
3991
+ *
3992
+ * The values are the keys of the manifest. This field is only present in JS chunks.
3993
+ */
3994
+ imports?: string[];
3995
+ /**
3996
+ * The list of dynamically imported chunks by this chunk
3997
+ *
3998
+ * The values are the keys of the manifest. This field is only present in JS chunks.
3999
+ */
4000
+ dynamicImports?: string[];
4001
+ }
4002
+ //#endregion
4003
+ //#region src/node/index.d.ts
4004
+ /** @deprecated - use `parseSync` instead */
4005
+ declare const parseAst: typeof parseAst$1;
4006
+ /** @deprecated - use `parse` instead */
4007
+ declare const parseAstAsync: typeof parseAstAsync$1;
4008
+ declare const esbuildVersion = "0.25.0";
4009
+ //#endregion
4010
+ export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESTree, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlAssetSource, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type KnownQueryTypeMap, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, type MinifyOptions, type MinifyResult, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type OxcOptions, type ParseResult, type ParserOptions, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type Rolldown, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, Visitor, type VisitorObject, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, type WsOptions, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, esmExternalRequirePlugin, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, minify, minifySync, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parse, parseAst, parseAstAsync, parseSync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rolldownVersion, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, transformWithOxc, VERSION as version, withFilter };