@inlang/paraglide-js 2.7.1 → 2.8.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 (274) hide show
  1. package/README.md +186 -7
  2. package/dist/bundler-plugins/esbuild.js +1 -0
  3. package/dist/bundler-plugins/esbuild.js.map +1 -0
  4. package/dist/bundler-plugins/index.js +1 -0
  5. package/dist/bundler-plugins/index.js.map +1 -0
  6. package/dist/bundler-plugins/rolldown.js +1 -0
  7. package/dist/bundler-plugins/rolldown.js.map +1 -0
  8. package/dist/bundler-plugins/rollup.d.ts +1 -1
  9. package/dist/bundler-plugins/rollup.d.ts.map +1 -1
  10. package/dist/bundler-plugins/rollup.js +1 -0
  11. package/dist/bundler-plugins/rollup.js.map +1 -0
  12. package/dist/bundler-plugins/rspack.d.ts +1 -1
  13. package/dist/bundler-plugins/rspack.d.ts.map +1 -1
  14. package/dist/bundler-plugins/rspack.js +1 -0
  15. package/dist/bundler-plugins/rspack.js.map +1 -0
  16. package/dist/bundler-plugins/unplugin.d.ts.map +1 -1
  17. package/dist/bundler-plugins/unplugin.js +31 -36
  18. package/dist/bundler-plugins/unplugin.js.map +1 -0
  19. package/dist/bundler-plugins/unplugin.test.js +1 -0
  20. package/dist/bundler-plugins/unplugin.test.js.map +1 -0
  21. package/dist/bundler-plugins/vite.d.ts +1 -1
  22. package/dist/bundler-plugins/vite.d.ts.map +1 -1
  23. package/dist/bundler-plugins/vite.js +1 -0
  24. package/dist/bundler-plugins/vite.js.map +1 -0
  25. package/dist/bundler-plugins/webpack.d.ts +1 -1
  26. package/dist/bundler-plugins/webpack.d.ts.map +1 -1
  27. package/dist/bundler-plugins/webpack.js +1 -0
  28. package/dist/bundler-plugins/webpack.js.map +1 -0
  29. package/dist/cli/commands/compile/command.d.ts.map +1 -1
  30. package/dist/cli/commands/compile/command.js +161 -17
  31. package/dist/cli/commands/compile/command.js.map +1 -0
  32. package/dist/cli/commands/init/command.d.ts.map +1 -1
  33. package/dist/cli/commands/init/command.js +8 -11
  34. package/dist/cli/commands/init/command.js.map +1 -0
  35. package/dist/cli/defaults.js +1 -0
  36. package/dist/cli/defaults.js.map +1 -0
  37. package/dist/cli/index.js +1 -0
  38. package/dist/cli/index.js.map +1 -0
  39. package/dist/cli/steps/add-vite-plugin.js +1 -0
  40. package/dist/cli/steps/add-vite-plugin.js.map +1 -0
  41. package/dist/cli/steps/add-vite-plugin.test.js +1 -0
  42. package/dist/cli/steps/add-vite-plugin.test.js.map +1 -0
  43. package/dist/cli/steps/check-for-uncomitted-changes.d.ts.map +1 -1
  44. package/dist/cli/steps/check-for-uncomitted-changes.js +3 -2
  45. package/dist/cli/steps/check-for-uncomitted-changes.js.map +1 -0
  46. package/dist/cli/steps/detect-bundler.js +1 -0
  47. package/dist/cli/steps/detect-bundler.js.map +1 -0
  48. package/dist/cli/steps/detect-bundler.test.js +1 -0
  49. package/dist/cli/steps/detect-bundler.test.js.map +1 -0
  50. package/dist/cli/steps/initialize-inlang-project.js +1 -0
  51. package/dist/cli/steps/initialize-inlang-project.js.map +1 -0
  52. package/dist/cli/steps/maybe-add-machine-translation.js +1 -0
  53. package/dist/cli/steps/maybe-add-machine-translation.js.map +1 -0
  54. package/dist/cli/steps/maybe-add-sherlock.d.ts.map +1 -1
  55. package/dist/cli/steps/maybe-add-sherlock.js +10 -3
  56. package/dist/cli/steps/maybe-add-sherlock.js.map +1 -0
  57. package/dist/cli/steps/prompt-for-outdir.js +2 -1
  58. package/dist/cli/steps/prompt-for-outdir.js.map +1 -0
  59. package/dist/cli/steps/update-package-json.js +1 -0
  60. package/dist/cli/steps/update-package-json.js.map +1 -0
  61. package/dist/cli/steps/update-ts-config.js +1 -0
  62. package/dist/cli/steps/update-ts-config.js.map +1 -0
  63. package/dist/cli/steps/update-ts-config.test.js +1 -0
  64. package/dist/cli/steps/update-ts-config.test.js.map +1 -0
  65. package/dist/cli/utils.js +1 -0
  66. package/dist/cli/utils.js.map +1 -0
  67. package/dist/compiler/compile-bundle.js +1 -0
  68. package/dist/compiler/compile-bundle.js.map +1 -0
  69. package/dist/compiler/compile-bundle.test.js +1 -0
  70. package/dist/compiler/compile-bundle.test.js.map +1 -0
  71. package/dist/compiler/compile-local-variable.js +1 -0
  72. package/dist/compiler/compile-local-variable.js.map +1 -0
  73. package/dist/compiler/compile-local-variable.test.js +1 -0
  74. package/dist/compiler/compile-local-variable.test.js.map +1 -0
  75. package/dist/compiler/compile-message.js +1 -0
  76. package/dist/compiler/compile-message.js.map +1 -0
  77. package/dist/compiler/compile-message.test.js +23 -0
  78. package/dist/compiler/compile-message.test.js.map +1 -0
  79. package/dist/compiler/compile-pattern.js +1 -0
  80. package/dist/compiler/compile-pattern.js.map +1 -0
  81. package/dist/compiler/compile-pattern.test.js +1 -0
  82. package/dist/compiler/compile-pattern.test.js.map +1 -0
  83. package/dist/compiler/compile-project.d.ts +2 -1
  84. package/dist/compiler/compile-project.d.ts.map +1 -1
  85. package/dist/compiler/compile-project.js +6 -1
  86. package/dist/compiler/compile-project.js.map +1 -0
  87. package/dist/compiler/compile-project.test.js +54 -0
  88. package/dist/compiler/compile-project.test.js.map +1 -0
  89. package/dist/compiler/compile.bench.js +1 -0
  90. package/dist/compiler/compile.bench.js.map +1 -0
  91. package/dist/compiler/compile.d.ts.map +1 -1
  92. package/dist/compiler/compile.js +2 -0
  93. package/dist/compiler/compile.js.map +1 -0
  94. package/dist/compiler/compile.test.js +27 -0
  95. package/dist/compiler/compile.test.js.map +1 -0
  96. package/dist/compiler/compiler-options.d.ts +18 -0
  97. package/dist/compiler/compiler-options.d.ts.map +1 -1
  98. package/dist/compiler/compiler-options.js +2 -0
  99. package/dist/compiler/compiler-options.js.map +1 -0
  100. package/dist/compiler/create-paraglide.js +1 -0
  101. package/dist/compiler/create-paraglide.js.map +1 -0
  102. package/dist/compiler/create-paraglide.test.js +1 -0
  103. package/dist/compiler/create-paraglide.test.js.map +1 -0
  104. package/dist/compiler/create-readme.d.ts +10 -0
  105. package/dist/compiler/create-readme.d.ts.map +1 -0
  106. package/dist/compiler/create-readme.js +104 -0
  107. package/dist/compiler/create-readme.js.map +1 -0
  108. package/dist/compiler/emit-ts-declarations.js +1 -0
  109. package/dist/compiler/emit-ts-declarations.js.map +1 -0
  110. package/dist/compiler/index.js +1 -0
  111. package/dist/compiler/index.js.map +1 -0
  112. package/dist/compiler/jsdoc-types.js +1 -0
  113. package/dist/compiler/jsdoc-types.js.map +1 -0
  114. package/dist/compiler/jsdoc-types.test.js +1 -0
  115. package/dist/compiler/jsdoc-types.test.js.map +1 -0
  116. package/dist/compiler/output-structure/locale-modules.js +1 -0
  117. package/dist/compiler/output-structure/locale-modules.js.map +1 -0
  118. package/dist/compiler/output-structure/locale-modules.test.js +1 -0
  119. package/dist/compiler/output-structure/locale-modules.test.js.map +1 -0
  120. package/dist/compiler/output-structure/message-modules.js +1 -0
  121. package/dist/compiler/output-structure/message-modules.js.map +1 -0
  122. package/dist/compiler/output-structure/message-modules.test.js +1 -0
  123. package/dist/compiler/output-structure/message-modules.test.js.map +1 -0
  124. package/dist/compiler/registry.js +1 -0
  125. package/dist/compiler/registry.js.map +1 -0
  126. package/dist/compiler/runtime/assert-is-locale.js +1 -0
  127. package/dist/compiler/runtime/assert-is-locale.js.map +1 -0
  128. package/dist/compiler/runtime/assert-is-locale.test.js +1 -0
  129. package/dist/compiler/runtime/assert-is-locale.test.js.map +1 -0
  130. package/dist/compiler/runtime/create-runtime.js +8 -1
  131. package/dist/compiler/runtime/create-runtime.js.map +1 -0
  132. package/dist/compiler/runtime/extract-locale-from-cookie.js +1 -0
  133. package/dist/compiler/runtime/extract-locale-from-cookie.js.map +1 -0
  134. package/dist/compiler/runtime/extract-locale-from-cookie.test.js +1 -0
  135. package/dist/compiler/runtime/extract-locale-from-cookie.test.js.map +1 -0
  136. package/dist/compiler/runtime/extract-locale-from-header.js +1 -0
  137. package/dist/compiler/runtime/extract-locale-from-header.js.map +1 -0
  138. package/dist/compiler/runtime/extract-locale-from-header.test.js +1 -0
  139. package/dist/compiler/runtime/extract-locale-from-header.test.js.map +1 -0
  140. package/dist/compiler/runtime/extract-locale-from-navigator.js +1 -0
  141. package/dist/compiler/runtime/extract-locale-from-navigator.js.map +1 -0
  142. package/dist/compiler/runtime/extract-locale-from-navigator.test.js +1 -0
  143. package/dist/compiler/runtime/extract-locale-from-navigator.test.js.map +1 -0
  144. package/dist/compiler/runtime/extract-locale-from-request-async.js +1 -0
  145. package/dist/compiler/runtime/extract-locale-from-request-async.js.map +1 -0
  146. package/dist/compiler/runtime/extract-locale-from-request-async.test.js +1 -0
  147. package/dist/compiler/runtime/extract-locale-from-request-async.test.js.map +1 -0
  148. package/dist/compiler/runtime/extract-locale-from-request.js +1 -0
  149. package/dist/compiler/runtime/extract-locale-from-request.js.map +1 -0
  150. package/dist/compiler/runtime/extract-locale-from-request.test.js +1 -0
  151. package/dist/compiler/runtime/extract-locale-from-request.test.js.map +1 -0
  152. package/dist/compiler/runtime/extract-locale-from-url.js +1 -0
  153. package/dist/compiler/runtime/extract-locale-from-url.js.map +1 -0
  154. package/dist/compiler/runtime/extract-locale-from-url.test.js +1 -0
  155. package/dist/compiler/runtime/extract-locale-from-url.test.js.map +1 -0
  156. package/dist/compiler/runtime/generate-static-localized-urls.js +1 -0
  157. package/dist/compiler/runtime/generate-static-localized-urls.js.map +1 -0
  158. package/dist/compiler/runtime/generate-static-localized-urls.test.js +1 -0
  159. package/dist/compiler/runtime/generate-static-localized-urls.test.js.map +1 -0
  160. package/dist/compiler/runtime/get-locale.js +1 -0
  161. package/dist/compiler/runtime/get-locale.js.map +1 -0
  162. package/dist/compiler/runtime/get-locale.test.js +1 -0
  163. package/dist/compiler/runtime/get-locale.test.js.map +1 -0
  164. package/dist/compiler/runtime/get-url-origin.js +1 -0
  165. package/dist/compiler/runtime/get-url-origin.js.map +1 -0
  166. package/dist/compiler/runtime/get-url-origin.test.js +1 -0
  167. package/dist/compiler/runtime/get-url-origin.test.js.map +1 -0
  168. package/dist/compiler/runtime/is-locale.js +1 -0
  169. package/dist/compiler/runtime/is-locale.js.map +1 -0
  170. package/dist/compiler/runtime/is-locale.test.js +1 -0
  171. package/dist/compiler/runtime/is-locale.test.js.map +1 -0
  172. package/dist/compiler/runtime/localize-href.js +1 -0
  173. package/dist/compiler/runtime/localize-href.js.map +1 -0
  174. package/dist/compiler/runtime/localize-href.test.js +1 -0
  175. package/dist/compiler/runtime/localize-href.test.js.map +1 -0
  176. package/dist/compiler/runtime/localize-url.js +1 -0
  177. package/dist/compiler/runtime/localize-url.js.map +1 -0
  178. package/dist/compiler/runtime/localize-url.test.js +1 -0
  179. package/dist/compiler/runtime/localize-url.test.js.map +1 -0
  180. package/dist/compiler/runtime/set-locale.js +1 -0
  181. package/dist/compiler/runtime/set-locale.js.map +1 -0
  182. package/dist/compiler/runtime/set-locale.test.js +1 -0
  183. package/dist/compiler/runtime/set-locale.test.js.map +1 -0
  184. package/dist/compiler/runtime/should-redirect.js +1 -0
  185. package/dist/compiler/runtime/should-redirect.js.map +1 -0
  186. package/dist/compiler/runtime/should-redirect.test.js +1 -0
  187. package/dist/compiler/runtime/should-redirect.test.js.map +1 -0
  188. package/dist/compiler/runtime/strategy.js +1 -0
  189. package/dist/compiler/runtime/strategy.js.map +1 -0
  190. package/dist/compiler/runtime/strategy.test.js +1 -0
  191. package/dist/compiler/runtime/strategy.test.js.map +1 -0
  192. package/dist/compiler/runtime/track-message-call.js +1 -0
  193. package/dist/compiler/runtime/track-message-call.js.map +1 -0
  194. package/dist/compiler/runtime/track-message-call.test.js +1 -0
  195. package/dist/compiler/runtime/track-message-call.test.js.map +1 -0
  196. package/dist/compiler/runtime/type.js +1 -0
  197. package/dist/compiler/runtime/type.js.map +1 -0
  198. package/dist/compiler/runtime/type.test.js +1 -0
  199. package/dist/compiler/runtime/type.test.js.map +1 -0
  200. package/dist/compiler/runtime/variables.js +1 -0
  201. package/dist/compiler/runtime/variables.js.map +1 -0
  202. package/dist/compiler/safe-module-id.js +1 -0
  203. package/dist/compiler/safe-module-id.js.map +1 -0
  204. package/dist/compiler/safe-module-id.test.js +1 -0
  205. package/dist/compiler/safe-module-id.test.js.map +1 -0
  206. package/dist/compiler/server/create-server-file.js +8 -1
  207. package/dist/compiler/server/create-server-file.js.map +1 -0
  208. package/dist/compiler/server/middleware.d.ts +40 -4
  209. package/dist/compiler/server/middleware.d.ts.map +1 -1
  210. package/dist/compiler/server/middleware.js +59 -9
  211. package/dist/compiler/server/middleware.js.map +1 -0
  212. package/dist/compiler/server/middleware.test.js +32 -0
  213. package/dist/compiler/server/middleware.test.js.map +1 -0
  214. package/dist/compiler/server/type.js +1 -0
  215. package/dist/compiler/server/type.js.map +1 -0
  216. package/dist/compiler/types.js +1 -0
  217. package/dist/compiler/types.js.map +1 -0
  218. package/dist/index.js +1 -0
  219. package/dist/index.js.map +1 -0
  220. package/dist/services/account/index.js +1 -0
  221. package/dist/services/account/index.js.map +1 -0
  222. package/dist/services/codegen/escape.js +1 -0
  223. package/dist/services/codegen/escape.js.map +1 -0
  224. package/dist/services/codegen/quotes.js +1 -0
  225. package/dist/services/codegen/quotes.js.map +1 -0
  226. package/dist/services/env-variables/create-index-file.js +1 -0
  227. package/dist/services/env-variables/create-index-file.js.map +1 -0
  228. package/dist/services/env-variables/index.js +2 -1
  229. package/dist/services/env-variables/index.js.map +1 -0
  230. package/dist/services/environment/package.js +1 -0
  231. package/dist/services/environment/package.js.map +1 -0
  232. package/dist/services/environment/package.test.js +1 -0
  233. package/dist/services/environment/package.test.js.map +1 -0
  234. package/dist/services/error-handling.js +1 -0
  235. package/dist/services/error-handling.js.map +1 -0
  236. package/dist/services/error-handling.test.js +1 -0
  237. package/dist/services/error-handling.test.js.map +1 -0
  238. package/dist/services/file-handling/exists.js +1 -0
  239. package/dist/services/file-handling/exists.js.map +1 -0
  240. package/dist/services/file-handling/exists.test.js +1 -0
  241. package/dist/services/file-handling/exists.test.js.map +1 -0
  242. package/dist/services/file-handling/types.js +1 -0
  243. package/dist/services/file-handling/types.js.map +1 -0
  244. package/dist/services/file-handling/write-output.js +1 -0
  245. package/dist/services/file-handling/write-output.js.map +1 -0
  246. package/dist/services/file-handling/write-output.test.js +1 -0
  247. package/dist/services/file-handling/write-output.test.js.map +1 -0
  248. package/dist/services/file-watching/tracked-fs.d.ts +26 -0
  249. package/dist/services/file-watching/tracked-fs.d.ts.map +1 -0
  250. package/dist/services/file-watching/tracked-fs.js +92 -0
  251. package/dist/services/file-watching/tracked-fs.js.map +1 -0
  252. package/dist/services/file-watching/tracked-fs.test.d.ts +2 -0
  253. package/dist/services/file-watching/tracked-fs.test.d.ts.map +1 -0
  254. package/dist/services/file-watching/tracked-fs.test.js +90 -0
  255. package/dist/services/file-watching/tracked-fs.test.js.map +1 -0
  256. package/dist/services/logger/index.js +1 -0
  257. package/dist/services/logger/index.js.map +1 -0
  258. package/dist/services/lookup.js +1 -0
  259. package/dist/services/lookup.js.map +1 -0
  260. package/dist/services/telemetry/capture.js +1 -0
  261. package/dist/services/telemetry/capture.js.map +1 -0
  262. package/dist/services/telemetry/capture.test.js +1 -0
  263. package/dist/services/telemetry/capture.test.js.map +1 -0
  264. package/dist/services/telemetry/stack-detection.js +1 -0
  265. package/dist/services/telemetry/stack-detection.js.map +1 -0
  266. package/dist/services/telemetry/stack-detection.test.js +1 -0
  267. package/dist/services/telemetry/stack-detection.test.js.map +1 -0
  268. package/dist/urlpattern-polyfill/index.js +1 -0
  269. package/dist/urlpattern-polyfill/index.js.map +1 -0
  270. package/dist/utilities/detect-json-formatting.js +1 -0
  271. package/dist/utilities/detect-json-formatting.js.map +1 -0
  272. package/dist/utilities/node-normalize-path.js +1 -0
  273. package/dist/utilities/node-normalize-path.js.map +1 -0
  274. package/package.json +17 -8
package/README.md CHANGED
@@ -1,14 +1,193 @@
1
- [![Inlang-ecosystem compatibility badge](https://cdn.jsdelivr.net/gh/opral/monorepo@main/inlang/assets/md-badges/inlang.svg)](https://inlang.com)
2
-
3
1
  [![NPM Downloads](https://img.shields.io/npm/dw/%40inlang%2Fparaglide-js?logo=npm&logoColor=red&label=npm%20downloads)](https://www.npmjs.com/package/@inlang/paraglide-js)
4
- [![Closed github issues](https://img.shields.io/github/issues-closed/opral/paraglide-js?logo=github&color=purple)](https://github.com/opral/inlang-paraglide-js/issues)
5
- [![Monorepo contributors](https://img.shields.io/github/contributors/opral/monorepo?logo=github)](https://github.com/opral/monorepo/graphs/contributors)
2
+ [![GitHub Issues](https://img.shields.io/github/issues-closed/opral/paraglide-js?logo=github&color=purple)](https://github.com/opral/paraglide-js/issues)
3
+ [![Contributors](https://img.shields.io/github/contributors/opral/paraglide-js?logo=github)](https://github.com/opral/paraglide-js/graphs/contributors)
4
+ [![Discord](https://img.shields.io/discord/897438559458430986?logo=discord&logoColor=white&label=discord)](https://discord.gg/gdMPPWy57R)
5
+
6
+ <p align="center">
7
+ <img src="https://cdn.jsdelivr.net/gh/opral/paraglide-js@latest/assets/header.png" alt="Paraglide JS" width="600" />
8
+ </p>
9
+
10
+ <h1 align="center">🪂 Paraglide JS</h1>
11
+ <p align="center">
12
+ <strong>Compiler-based i18n library that emits tree-shakable translations, leading to up to 70% smaller bundle sizes.</strong>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs"><strong>Documentation</strong></a> ·
17
+ <a href="#quick-start"><strong>Quick Start</strong></a> ·
18
+ <a href="https://github.com/opral/inlang-paraglide-js/issues"><strong>Report Bug</strong></a>
19
+ </p>
20
+
21
+ <p align="center">
22
+ <sub>Used in production by</sub><br/><br/>
23
+ <a href="https://michelin.com"><img src="https://www.google.com/s2/favicons?domain=michelin.com&sz=32" alt="Michelin" height="24" /></a>&nbsp;&nbsp;&nbsp;
24
+ <a href="https://idealista.com"><img src="https://www.google.com/s2/favicons?domain=idealista.com&sz=32" alt="Idealista" height="24" /></a>&nbsp;&nbsp;&nbsp;
25
+ <a href="https://architonic.com"><img src="https://www.google.com/s2/favicons?domain=architonic.com&sz=32" alt="Architonic" height="24" /></a>&nbsp;&nbsp;&nbsp;
26
+ <a href="https://0.email"><img src="https://www.google.com/s2/favicons?domain=0.email&sz=32" alt="0.email" height="24" /></a>&nbsp;&nbsp;&nbsp;
27
+ <sub>...and more</sub>
28
+ </p>
29
+
30
+ <p align="center">
31
+ <sub>Trusted by framework authors</sub><br/><br/>
32
+ <a href="https://svelte.dev/docs/cli/paraglide"><img src="https://cdn.simpleicons.org/svelte/FF3E00" alt="Svelte" height="14" /> Svelte's official i18n recommendation</a><br/>
33
+ <a href="https://github.com/TanStack/router/tree/main/e2e/react-router/i18n-paraglide"><img src="https://tanstack.com/images/logos/logo-color-100.png" alt="TanStack" height="14" /> Part of TanStack's CI pipeline</a>
34
+ </p>
35
+
36
+ ## Code Preview
37
+
38
+ ```js
39
+ // messages/en.json
40
+ {
41
+ "greeting": "Hello {name}!"
42
+ }
43
+ ```
44
+
45
+ ```js
46
+ import { m } from "./paraglide/messages.js";
47
+
48
+ m.greeting({ name: "World" }); // "Hello World!" — fully typesafe
49
+ ```
50
+
51
+ The compiler generates typed message functions. Your bundler tree-shakes unused messages. Expect [**up to 70% smaller bundle sizes**](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/benchmark) compared to runtime i18n libraries (e.g. 47 KB vs 205 KB).
52
+
53
+ ## Why Paraglide?
54
+
55
+ | | |
56
+ | ------------------------- | -------------------------------------------------------------------------- |
57
+ | **Smaller Bundle Sizes** | Up to 70% smaller than runtime i18n libraries. |
58
+ | **Tree-Shakable** | Unused messages are eliminated by your bundler. |
59
+ | **Fully Typesafe** | Autocomplete for message keys and parameters. Typos become compile errors. |
60
+ | **Framework Agnostic** | Works with React, Vue, Svelte, Solid, TanStack, or vanilla JS/TS. |
61
+ | **Built-in i18n Routing** | URL-based locale detection and localized paths out of the box. |
62
+ | **Built on inlang** | Integrates with VS Code extension, CLI, and translation editor. |
63
+
64
+ ## Works With Your Stack
65
+
66
+ <p>
67
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs/vite"><img src="https://cdn.simpleicons.org/react/61DAFB" alt="React" width="18" height="18" /> React</a> ·
68
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs/vite"><img src="https://cdn.simpleicons.org/vuedotjs/4FC08D" alt="Vue" width="18" height="18" /> Vue</a> ·
69
+ <a href="https://github.com/TanStack/router/tree/main/examples/react/start-i18n-paraglide"><img src="https://tanstack.com/images/logos/logo-color-100.png" alt="TanStack" width="18" height="18" /> TanStack Start</a> ·
70
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs/sveltekit"><img src="https://cdn.simpleicons.org/svelte/FF3E00" alt="Svelte" width="18" height="18" /> SvelteKit</a> ·
71
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs/next-js"><img src="https://cdn.simpleicons.org/nextdotjs" alt="Next.js" width="18" height="18" /> Next.js</a> ·
72
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs/astro"><img src="https://cdn.simpleicons.org/astro/FF5D01" alt="Astro" width="18" height="18" /> Astro</a> ·
73
+ <a href="https://inlang.com/m/gerre34r/library-inlang-paraglideJs/vanilla-js-ts"><img src="https://cdn.simpleicons.org/javascript/F7DF1E" alt="JavaScript" width="18" height="18" /> Vanilla JS/TS</a>
74
+ </p>
75
+
76
+ ## Quick Start
77
+
78
+ ```bash
79
+ npx @inlang/paraglide-js init
80
+ ```
81
+
82
+ The CLI sets up everything:
83
+
84
+ - Creates your message files
85
+ - Configures your bundler (Vite, Webpack, etc.)
86
+ - Generates typesafe message functions
87
+
88
+ Then use your messages:
89
+
90
+ ```js
91
+ import { m } from "./paraglide/messages.js";
92
+ import { setLocale, getLocale } from "./paraglide/runtime.js";
93
+
94
+ // Use messages (typesafe, with autocomplete)
95
+ m.hello_world();
96
+ m.greeting({ name: "Ada" });
97
+
98
+ // Get/set locale
99
+ getLocale(); // "en"
100
+ setLocale("de"); // switches to German
101
+ ```
102
+
103
+ **[Full Getting Started Guide →](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)**
6
104
 
105
+ ## How It Works
7
106
 
8
- A compiler-based i18n library that emits tree-shakable message functions. This means that only the messages you actually use are loaded without asynchronous waterfalls.
107
+ ```
108
+ ┌────────────────┐ ┌────────────────────┐ ┌──────────────────────────┐
109
+ │ Inlang Project │ ───▶ │ Paraglide Compiler │ ───▶ │ ./paraglide/messages.js │
110
+ └────────────────┘ └────────────────────┘ │ ./paraglide/runtime.js │
111
+ └──────────────────────────┘
112
+ ```
9
113
 
10
- Visit https://inlang.com/m/gerre34r/library-inlang-paraglideJs to learn more.
114
+ Paraglide compiles an [inlang project](https://inlang.com/docs/introduction#how-it-works) into tree-shakable message functions. Your bundler eliminates unused messages at build time.
115
+
116
+ ## Message Format
117
+
118
+ Paraglide uses `Intl.PluralRules` for locale-aware pluralization, supporting all CLDR plural categories (zero, one, two, few, many, other) and ordinals (1st, 2nd, 3rd). Gender and custom selects are supported via the variants system.
119
+
120
+ ```js
121
+ // Pluralization example
122
+ m.items_in_cart({ count: 1 }); // "1 item in cart"
123
+ m.items_in_cart({ count: 5 }); // "5 items in cart"
124
+
125
+ // Works correctly for complex locales (Russian, Arabic, etc.)
126
+ ```
127
+
128
+ Message format is **plugin-based** — use the default inlang format, or switch to i18next, JSON, or ICU MessageFormat via [plugins](https://inlang.com/c/plugins).
129
+
130
+ **[Pluralization & Variants Docs →](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/variants)**
131
+
132
+ ## Comparison
133
+
134
+ | Feature | Paraglide | i18next | react-intl |
135
+ | ---------------------- | ----------- | --------------- | ---------- |
136
+ | **Bundle size** | Up to 70% smaller via tree-shaking | ❌ Ships all messages | ❌ Ships all messages |
137
+ | **Tree-shakable** | ✅ | ❌ | ❌ |
138
+ | **Typesafe** | ✅ | Partial | ❌ |
139
+ | **Framework agnostic** | ✅ | Wrappers needed | React only |
140
+ | **i18n routing** | ✅ Built-in | ❌ | ❌ |
141
+
142
+ **[Full Comparison →](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/comparison)**
143
+
144
+ ## What Developers Say
145
+
146
+ > **"Paraglide JS is by far the best option when it comes to internationalization. Nothing better on the market."**
147
+ >
148
+ > Ancient-Background17 · Reddit
149
+
150
+ > **"Just tried Paraglide JS. This is how i18n should be done! Totally new level of DX."**
151
+ >
152
+ > Patrik Engborg · [@patrikengborg](https://twitter.com/patrikengborg/status/1747260930873053674)
153
+
154
+ > **"I was messing with various i18n frameworks and must say Paraglide was the smoothest experience. SSG and SSR worked out of the box."**
155
+ >
156
+ > Dalibor Hon · Discord
157
+
158
+ ## Talks
159
+
160
+ - [Paraglide JS 1.0 announcement](https://www.youtube.com/watch?v=-YES3CCAG90)
161
+ - [Svelte London January 2024 Meetup](https://www.youtube.com/watch?v=eswNQiq4T2w&t=646s)
162
+
163
+ ## Ecosystem
164
+
165
+ Paraglide is built on the [open inlang format](https://github.com/opral/inlang-sdk). Works with:
166
+
167
+ | Tool | Description |
168
+ | ----------------------------------------------------------------------- | ------------------------------------------------ |
169
+ | [Sherlock](https://inlang.com/m/r7kp499g/app-inlang-ideExtension) | VS Code extension for inline translation editing |
170
+ | [CLI](https://inlang.com/m/2qj2w8pu/app-inlang-cli) | Machine translate from the terminal |
171
+ | [Fink](https://inlang.com/m/tdozzpar/app-inlang-finkLocalizationEditor) | Translation editor for non-developers |
172
+ | [Parrot](https://inlang.com/m/gkrpgoir/app-parrot-figmaPlugin) | Manage translations in Figma |
173
+
174
+ **[Explore the inlang ecosystem →](https://inlang.com/c/apps)**
175
+
176
+ ## Documentation
177
+
178
+ - [Getting Started](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)
179
+ - [Framework Guides](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/next-js) (Next.js, SvelteKit, Astro, etc.)
180
+ - [Message Syntax & Pluralization](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/variants)
181
+ - [Routing & SSR](https://inlang.com/m/gerre34r/library-inlang-paraglideJs/server-side-rendering)
182
+ - [API Reference](https://inlang.com/m/gerre34r/library-inlang-paraglideJs)
11
183
 
12
184
  ## Contributing
13
185
 
14
- Read the [CONTRIBUTING.md](https://github.com/opral/monorepo/blob/main/inlang/packages/paraglide/paraglide-js/CONTRIBUTING.md) file to learn more on how to contribute.
186
+ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
187
+
188
+ - [GitHub Issues](https://github.com/opral/inlang-paraglide-js/issues)
189
+ - [Discord Community](https://discord.gg/gdMPPWy57R)
190
+
191
+ ## License
192
+
193
+ MIT — see [LICENSE](./LICENSE)
@@ -1,3 +1,4 @@
1
1
  import { createEsbuildPlugin } from "unplugin";
2
2
  import { unpluginFactory } from "./unplugin.js";
3
3
  export const paraglideEsbuildPlugin = createEsbuildPlugin(unpluginFactory);
4
+ //# sourceMappingURL=esbuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.js","sourceRoot":"","sources":["../../src/bundler-plugins/esbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC"}
@@ -4,3 +4,4 @@ export { paraglideRollupPlugin } from "./rollup.js";
4
4
  export { paraglideRspackPlugin } from "./rspack.js";
5
5
  export { paraglideVitePlugin } from "./vite.js";
6
6
  export { paraglideWebpackPlugin } from "./webpack.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bundler-plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { createRolldownPlugin } from "unplugin";
2
2
  import { unpluginFactory } from "./unplugin.js";
3
3
  export const paraglideRolldownPlugin = createRolldownPlugin(unpluginFactory);
4
+ //# sourceMappingURL=rolldown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolldown.js","sourceRoot":"","sources":["../../src/bundler-plugins/rolldown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const paraglideRollupPlugin: (options: import("../index.js").CompilerOptions) => import("unplugin").RollupPlugin<any> | import("unplugin").RollupPlugin<any>[];
1
+ export declare const paraglideRollupPlugin: (options: import("../index.js").CompilerOptions) => import("rollup").Plugin<any> | import("rollup").Plugin<any>[];
2
2
  //# sourceMappingURL=rollup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/rollup.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,mIAAsC,CAAC"}
1
+ {"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/rollup.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,mHAAsC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { createRollupPlugin } from "unplugin";
2
2
  import { unpluginFactory } from "./unplugin.js";
3
3
  export const paraglideRollupPlugin = createRollupPlugin(unpluginFactory);
4
+ //# sourceMappingURL=rollup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../src/bundler-plugins/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const paraglideRspackPlugin: (options: import("../index.js").CompilerOptions) => import("unplugin").RspackPluginInstance;
1
+ export declare const paraglideRspackPlugin: (options: import("../index.js").CompilerOptions) => RspackPluginInstance;
2
2
  //# sourceMappingURL=rspack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/rspack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,6FAAsC,CAAC"}
1
+ {"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/rspack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,0EAAsC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { createRspackPlugin } from "unplugin";
2
2
  import { unpluginFactory } from "./unplugin.js";
3
3
  export const paraglideRspackPlugin = createRspackPlugin(unpluginFactory);
4
+ //# sourceMappingURL=rspack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.js","sourceRoot":"","sources":["../../src/bundler-plugins/rspack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"unplugin.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/unplugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavE,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,eAAe,CA2H3D,CAAC"}
1
+ {"version":3,"file":"unplugin.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/unplugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAoBvE,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,eAAe,CA6I3D,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { compile } from "../compiler/compile.js";
2
- import fs from "node:fs";
3
- import { resolve, relative } from "node:path";
4
- import { nodeNormalizePath } from "../utilities/node-normalize-path.js";
2
+ import { relative } from "node:path";
5
3
  import { Logger } from "../services/logger/index.js";
4
+ import { createTrackedFs, getWatchTargets, isPathWithinDirectories, } from "../services/file-watching/tracked-fs.js";
5
+ import { nodeNormalizePath } from "../utilities/node-normalize-path.js";
6
6
  const PLUGIN_NAME = "unplugin-paraglide-js";
7
7
  const logger = new Logger();
8
8
  /**
@@ -10,6 +10,7 @@ const logger = new Logger();
10
10
  */
11
11
  let isServer;
12
12
  let previousCompilation;
13
+ const { fs: trackedFs, readFiles, clearReadFiles } = createTrackedFs();
13
14
  export const unpluginFactory = (args) => ({
14
15
  name: PLUGIN_NAME,
15
16
  enforce: "pre",
@@ -21,7 +22,7 @@ export const unpluginFactory = (args) => ({
21
22
  (isProduction ? "message-modules" : "locale-modules");
22
23
  try {
23
24
  previousCompilation = await compile({
24
- fs: wrappedFs,
25
+ fs: trackedFs,
25
26
  previousCompilation,
26
27
  outputStructure,
27
28
  // webpack invokes the `buildStart` api in watch mode,
@@ -41,13 +42,23 @@ export const unpluginFactory = (args) => ({
41
42
  }
42
43
  finally {
43
44
  // in any case add the files to watch
44
- for (const path of Array.from(readFiles)) {
45
- this.addWatchFile(path);
45
+ const targets = getWatchTargets(readFiles, { outdir: args.outdir });
46
+ for (const filePath of targets.files) {
47
+ this.addWatchFile(filePath);
48
+ }
49
+ for (const directoryPath of targets.directories) {
50
+ this.addWatchFile(directoryPath);
46
51
  }
47
52
  }
48
53
  },
49
54
  async watchChange(path) {
50
- const shouldCompile = readFiles.has(path) && !path.includes("cache");
55
+ const normalizedPath = nodeNormalizePath(path);
56
+ const targets = getWatchTargets(readFiles, { outdir: args.outdir });
57
+ if (targets.isIgnoredPath(normalizedPath)) {
58
+ return;
59
+ }
60
+ const shouldCompile = targets.files.has(normalizedPath) ||
61
+ isPathWithinDirectories(normalizedPath, targets.directories);
51
62
  if (shouldCompile === false) {
52
63
  return;
53
64
  }
@@ -60,9 +71,9 @@ export const unpluginFactory = (args) => ({
60
71
  try {
61
72
  logger.info(`Re-compiling inlang project... File "${relative(process.cwd(), path)}" has changed.`);
62
73
  // Clear readFiles to track fresh file reads
63
- readFiles.clear();
74
+ clearReadFiles();
64
75
  previousCompilation = await compile({
65
- fs: wrappedFs,
76
+ fs: trackedFs,
66
77
  previousCompilation,
67
78
  outputStructure,
68
79
  cleanOutdir: false,
@@ -71,12 +82,19 @@ export const unpluginFactory = (args) => ({
71
82
  });
72
83
  logger.success(`Re-compilation complete (${outputStructure})`);
73
84
  // Add any new files to watch
74
- for (const filePath of Array.from(readFiles)) {
85
+ const nextTargets = getWatchTargets(readFiles, { outdir: args.outdir });
86
+ for (const filePath of nextTargets.files) {
75
87
  this.addWatchFile(filePath);
76
88
  }
89
+ for (const directoryPath of nextTargets.directories) {
90
+ this.addWatchFile(directoryPath);
91
+ }
77
92
  }
78
93
  catch (e) {
79
- readFiles = previouslyReadFiles;
94
+ clearReadFiles();
95
+ for (const filePath of previouslyReadFiles) {
96
+ readFiles.add(filePath);
97
+ }
80
98
  // Reset compilation result on error
81
99
  previousCompilation = undefined;
82
100
  logger.warn("Failed to re-compile project:", e.message);
@@ -106,7 +124,7 @@ export const unpluginFactory = (args) => ({
106
124
  (isProduction ? "message-modules" : "locale-modules");
107
125
  try {
108
126
  previousCompilation = await compile({
109
- fs: wrappedFs,
127
+ fs: trackedFs,
110
128
  previousCompilation,
111
129
  outputStructure,
112
130
  // clean dir needs to be false. otherwise webpack get's into a race condition
@@ -126,27 +144,4 @@ export const unpluginFactory = (args) => ({
126
144
  });
127
145
  },
128
146
  });
129
- let readFiles = new Set();
130
- // Create a wrapper around the fs object to intercept and store read files
131
- const wrappedFs = {
132
- ...fs,
133
- // @ts-expect-error - Node's fs has too many overloads
134
- readFile: (path, options, callback) => {
135
- readFiles.add(nodeNormalizePath(resolve(process.cwd(), path.toString())));
136
- return fs.readFile(path, options, callback);
137
- },
138
- // @ts-expect-error - Node's fs has too many overloads
139
- readFileSync: (path, options) => {
140
- readFiles.add(nodeNormalizePath(resolve(process.cwd(), path.toString())));
141
- return fs.readFileSync(path, options);
142
- },
143
- promises: {
144
- ...fs.promises,
145
- // @ts-expect-error - Node's fs.promises has too many overloads
146
- readFile: async (path, options) => {
147
- readFiles.add(nodeNormalizePath(resolve(process.cwd(), path.toString())));
148
- return fs.promises.readFile(path, options);
149
- },
150
- },
151
- // Add other fs methods as needed
152
- };
147
+ //# sourceMappingURL=unplugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.js","sourceRoot":"","sources":["../../src/bundler-plugins/unplugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAA0B,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EACN,eAAe,EACf,eAAe,EACf,uBAAuB,GACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAE5B;;GAEG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K,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;YAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC;YAC3D,uEAAuE;YACvE,0DAA0D;YAC1D,MAAM,eAAe,GACpB,IAAI,CAAC,eAAe;gBACpB,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;YACvD,IAAI,CAAC;gBACJ,mBAAmB,GAAG,MAAM,OAAO,CAAC;oBACnC,EAAE,EAAE,SAAS;oBACb,mBAAmB;oBACnB,eAAe;oBACf,6EAA6E;oBAC7E,0EAA0E;oBAC1E,2BAA2B;oBAC3B,WAAW,EAAE,KAAK;oBAClB,GAAG,IAAI;iBACP,CAAC,CAAC;gBACH,MAAM,CAAC,OAAO,CAAC,yBAAyB,eAAe,GAAG,CAAC,CAAC;YAC7D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;gBACpE,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;gBACtE,IAAI,YAAY;oBAAE,MAAM,KAAK,CAAC;YAC/B,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC,CAAC"}
@@ -73,3 +73,4 @@ test("vite plugin throws on compilation errors at build time", async () => {
73
73
  // In production mode - should throw the error
74
74
  await expect(plugin.buildStart?.call(mockContext)).rejects.toThrow();
75
75
  });
76
+ //# sourceMappingURL=unplugin.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.test.js","sourceRoot":"","sources":["../../src/bundler-plugins/unplugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,EAAE,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AU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const paraglideVitePlugin: (options: import("../index.js").CompilerOptions) => import("unplugin").VitePlugin<any> | import("unplugin").VitePlugin<any>[];
1
+ export declare const paraglideVitePlugin: (options: import("../index.js").CompilerOptions) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
2
2
  //# sourceMappingURL=vite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/vite.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,+HAAoC,CAAC"}
1
+ {"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/vite.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,+GAAoC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { createVitePlugin } from "unplugin";
2
2
  import { unpluginFactory } from "./unplugin.js";
3
3
  export const paraglideVitePlugin = createVitePlugin(unpluginFactory);
4
+ //# sourceMappingURL=vite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/bundler-plugins/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const paraglideWebpackPlugin: (options: import("../index.js").CompilerOptions) => import("unplugin").WebpackPluginInstance;
1
+ export declare const paraglideWebpackPlugin: (options: import("../index.js").CompilerOptions) => WebpackPluginInstance;
2
2
  //# sourceMappingURL=webpack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/webpack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,8FAAuC,CAAC"}
1
+ {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/webpack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,2EAAuC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { createWebpackPlugin } from "unplugin";
2
2
  import { unpluginFactory } from "./unplugin.js";
3
3
  export const paraglideWebpackPlugin = createWebpackPlugin(unpluginFactory);
4
+ //# sourceMappingURL=webpack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.js","sourceRoot":"","sources":["../../src/bundler-plugins/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/compile/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,eAAO,MAAM,cAAc,SA4DzB,CAAC"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/compile/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,eAAO,MAAM,cAAc,SAoOzB,CAAC"}