@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.
- package/README.md +186 -7
- package/dist/bundler-plugins/esbuild.js +1 -0
- package/dist/bundler-plugins/esbuild.js.map +1 -0
- package/dist/bundler-plugins/index.js +1 -0
- package/dist/bundler-plugins/index.js.map +1 -0
- package/dist/bundler-plugins/rolldown.js +1 -0
- package/dist/bundler-plugins/rolldown.js.map +1 -0
- package/dist/bundler-plugins/rollup.d.ts +1 -1
- package/dist/bundler-plugins/rollup.d.ts.map +1 -1
- package/dist/bundler-plugins/rollup.js +1 -0
- package/dist/bundler-plugins/rollup.js.map +1 -0
- package/dist/bundler-plugins/rspack.d.ts +1 -1
- package/dist/bundler-plugins/rspack.d.ts.map +1 -1
- package/dist/bundler-plugins/rspack.js +1 -0
- package/dist/bundler-plugins/rspack.js.map +1 -0
- package/dist/bundler-plugins/unplugin.d.ts.map +1 -1
- package/dist/bundler-plugins/unplugin.js +31 -36
- package/dist/bundler-plugins/unplugin.js.map +1 -0
- package/dist/bundler-plugins/unplugin.test.js +1 -0
- package/dist/bundler-plugins/unplugin.test.js.map +1 -0
- package/dist/bundler-plugins/vite.d.ts +1 -1
- package/dist/bundler-plugins/vite.d.ts.map +1 -1
- package/dist/bundler-plugins/vite.js +1 -0
- package/dist/bundler-plugins/vite.js.map +1 -0
- package/dist/bundler-plugins/webpack.d.ts +1 -1
- package/dist/bundler-plugins/webpack.d.ts.map +1 -1
- package/dist/bundler-plugins/webpack.js +1 -0
- package/dist/bundler-plugins/webpack.js.map +1 -0
- package/dist/cli/commands/compile/command.d.ts.map +1 -1
- package/dist/cli/commands/compile/command.js +161 -17
- package/dist/cli/commands/compile/command.js.map +1 -0
- package/dist/cli/commands/init/command.d.ts.map +1 -1
- package/dist/cli/commands/init/command.js +8 -11
- package/dist/cli/commands/init/command.js.map +1 -0
- package/dist/cli/defaults.js +1 -0
- package/dist/cli/defaults.js.map +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/steps/add-vite-plugin.js +1 -0
- package/dist/cli/steps/add-vite-plugin.js.map +1 -0
- package/dist/cli/steps/add-vite-plugin.test.js +1 -0
- package/dist/cli/steps/add-vite-plugin.test.js.map +1 -0
- package/dist/cli/steps/check-for-uncomitted-changes.d.ts.map +1 -1
- package/dist/cli/steps/check-for-uncomitted-changes.js +3 -2
- package/dist/cli/steps/check-for-uncomitted-changes.js.map +1 -0
- package/dist/cli/steps/detect-bundler.js +1 -0
- package/dist/cli/steps/detect-bundler.js.map +1 -0
- package/dist/cli/steps/detect-bundler.test.js +1 -0
- package/dist/cli/steps/detect-bundler.test.js.map +1 -0
- package/dist/cli/steps/initialize-inlang-project.js +1 -0
- package/dist/cli/steps/initialize-inlang-project.js.map +1 -0
- package/dist/cli/steps/maybe-add-machine-translation.js +1 -0
- package/dist/cli/steps/maybe-add-machine-translation.js.map +1 -0
- package/dist/cli/steps/maybe-add-sherlock.d.ts.map +1 -1
- package/dist/cli/steps/maybe-add-sherlock.js +10 -3
- package/dist/cli/steps/maybe-add-sherlock.js.map +1 -0
- package/dist/cli/steps/prompt-for-outdir.js +2 -1
- package/dist/cli/steps/prompt-for-outdir.js.map +1 -0
- package/dist/cli/steps/update-package-json.js +1 -0
- package/dist/cli/steps/update-package-json.js.map +1 -0
- package/dist/cli/steps/update-ts-config.js +1 -0
- package/dist/cli/steps/update-ts-config.js.map +1 -0
- package/dist/cli/steps/update-ts-config.test.js +1 -0
- package/dist/cli/steps/update-ts-config.test.js.map +1 -0
- package/dist/cli/utils.js +1 -0
- package/dist/cli/utils.js.map +1 -0
- package/dist/compiler/compile-bundle.js +1 -0
- package/dist/compiler/compile-bundle.js.map +1 -0
- package/dist/compiler/compile-bundle.test.js +1 -0
- package/dist/compiler/compile-bundle.test.js.map +1 -0
- package/dist/compiler/compile-local-variable.js +1 -0
- package/dist/compiler/compile-local-variable.js.map +1 -0
- package/dist/compiler/compile-local-variable.test.js +1 -0
- package/dist/compiler/compile-local-variable.test.js.map +1 -0
- package/dist/compiler/compile-message.js +1 -0
- package/dist/compiler/compile-message.js.map +1 -0
- package/dist/compiler/compile-message.test.js +23 -0
- package/dist/compiler/compile-message.test.js.map +1 -0
- package/dist/compiler/compile-pattern.js +1 -0
- package/dist/compiler/compile-pattern.js.map +1 -0
- package/dist/compiler/compile-pattern.test.js +1 -0
- package/dist/compiler/compile-pattern.test.js.map +1 -0
- package/dist/compiler/compile-project.d.ts +2 -1
- package/dist/compiler/compile-project.d.ts.map +1 -1
- package/dist/compiler/compile-project.js +6 -1
- package/dist/compiler/compile-project.js.map +1 -0
- package/dist/compiler/compile-project.test.js +54 -0
- package/dist/compiler/compile-project.test.js.map +1 -0
- package/dist/compiler/compile.bench.js +1 -0
- package/dist/compiler/compile.bench.js.map +1 -0
- package/dist/compiler/compile.d.ts.map +1 -1
- package/dist/compiler/compile.js +2 -0
- package/dist/compiler/compile.js.map +1 -0
- package/dist/compiler/compile.test.js +27 -0
- package/dist/compiler/compile.test.js.map +1 -0
- package/dist/compiler/compiler-options.d.ts +18 -0
- package/dist/compiler/compiler-options.d.ts.map +1 -1
- package/dist/compiler/compiler-options.js +2 -0
- package/dist/compiler/compiler-options.js.map +1 -0
- package/dist/compiler/create-paraglide.js +1 -0
- package/dist/compiler/create-paraglide.js.map +1 -0
- package/dist/compiler/create-paraglide.test.js +1 -0
- package/dist/compiler/create-paraglide.test.js.map +1 -0
- package/dist/compiler/create-readme.d.ts +10 -0
- package/dist/compiler/create-readme.d.ts.map +1 -0
- package/dist/compiler/create-readme.js +104 -0
- package/dist/compiler/create-readme.js.map +1 -0
- package/dist/compiler/emit-ts-declarations.js +1 -0
- package/dist/compiler/emit-ts-declarations.js.map +1 -0
- package/dist/compiler/index.js +1 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/jsdoc-types.js +1 -0
- package/dist/compiler/jsdoc-types.js.map +1 -0
- package/dist/compiler/jsdoc-types.test.js +1 -0
- package/dist/compiler/jsdoc-types.test.js.map +1 -0
- package/dist/compiler/output-structure/locale-modules.js +1 -0
- package/dist/compiler/output-structure/locale-modules.js.map +1 -0
- package/dist/compiler/output-structure/locale-modules.test.js +1 -0
- package/dist/compiler/output-structure/locale-modules.test.js.map +1 -0
- package/dist/compiler/output-structure/message-modules.js +1 -0
- package/dist/compiler/output-structure/message-modules.js.map +1 -0
- package/dist/compiler/output-structure/message-modules.test.js +1 -0
- package/dist/compiler/output-structure/message-modules.test.js.map +1 -0
- package/dist/compiler/registry.js +1 -0
- package/dist/compiler/registry.js.map +1 -0
- package/dist/compiler/runtime/assert-is-locale.js +1 -0
- package/dist/compiler/runtime/assert-is-locale.js.map +1 -0
- package/dist/compiler/runtime/assert-is-locale.test.js +1 -0
- package/dist/compiler/runtime/assert-is-locale.test.js.map +1 -0
- package/dist/compiler/runtime/create-runtime.js +8 -1
- package/dist/compiler/runtime/create-runtime.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.test.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-cookie.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.test.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-header.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.test.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-navigator.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.test.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-request-async.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.test.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-request.test.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.js.map +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.test.js +1 -0
- package/dist/compiler/runtime/extract-locale-from-url.test.js.map +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.js +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.js.map +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.test.js +1 -0
- package/dist/compiler/runtime/generate-static-localized-urls.test.js.map +1 -0
- package/dist/compiler/runtime/get-locale.js +1 -0
- package/dist/compiler/runtime/get-locale.js.map +1 -0
- package/dist/compiler/runtime/get-locale.test.js +1 -0
- package/dist/compiler/runtime/get-locale.test.js.map +1 -0
- package/dist/compiler/runtime/get-url-origin.js +1 -0
- package/dist/compiler/runtime/get-url-origin.js.map +1 -0
- package/dist/compiler/runtime/get-url-origin.test.js +1 -0
- package/dist/compiler/runtime/get-url-origin.test.js.map +1 -0
- package/dist/compiler/runtime/is-locale.js +1 -0
- package/dist/compiler/runtime/is-locale.js.map +1 -0
- package/dist/compiler/runtime/is-locale.test.js +1 -0
- package/dist/compiler/runtime/is-locale.test.js.map +1 -0
- package/dist/compiler/runtime/localize-href.js +1 -0
- package/dist/compiler/runtime/localize-href.js.map +1 -0
- package/dist/compiler/runtime/localize-href.test.js +1 -0
- package/dist/compiler/runtime/localize-href.test.js.map +1 -0
- package/dist/compiler/runtime/localize-url.js +1 -0
- package/dist/compiler/runtime/localize-url.js.map +1 -0
- package/dist/compiler/runtime/localize-url.test.js +1 -0
- package/dist/compiler/runtime/localize-url.test.js.map +1 -0
- package/dist/compiler/runtime/set-locale.js +1 -0
- package/dist/compiler/runtime/set-locale.js.map +1 -0
- package/dist/compiler/runtime/set-locale.test.js +1 -0
- package/dist/compiler/runtime/set-locale.test.js.map +1 -0
- package/dist/compiler/runtime/should-redirect.js +1 -0
- package/dist/compiler/runtime/should-redirect.js.map +1 -0
- package/dist/compiler/runtime/should-redirect.test.js +1 -0
- package/dist/compiler/runtime/should-redirect.test.js.map +1 -0
- package/dist/compiler/runtime/strategy.js +1 -0
- package/dist/compiler/runtime/strategy.js.map +1 -0
- package/dist/compiler/runtime/strategy.test.js +1 -0
- package/dist/compiler/runtime/strategy.test.js.map +1 -0
- package/dist/compiler/runtime/track-message-call.js +1 -0
- package/dist/compiler/runtime/track-message-call.js.map +1 -0
- package/dist/compiler/runtime/track-message-call.test.js +1 -0
- package/dist/compiler/runtime/track-message-call.test.js.map +1 -0
- package/dist/compiler/runtime/type.js +1 -0
- package/dist/compiler/runtime/type.js.map +1 -0
- package/dist/compiler/runtime/type.test.js +1 -0
- package/dist/compiler/runtime/type.test.js.map +1 -0
- package/dist/compiler/runtime/variables.js +1 -0
- package/dist/compiler/runtime/variables.js.map +1 -0
- package/dist/compiler/safe-module-id.js +1 -0
- package/dist/compiler/safe-module-id.js.map +1 -0
- package/dist/compiler/safe-module-id.test.js +1 -0
- package/dist/compiler/safe-module-id.test.js.map +1 -0
- package/dist/compiler/server/create-server-file.js +8 -1
- package/dist/compiler/server/create-server-file.js.map +1 -0
- package/dist/compiler/server/middleware.d.ts +40 -4
- package/dist/compiler/server/middleware.d.ts.map +1 -1
- package/dist/compiler/server/middleware.js +59 -9
- package/dist/compiler/server/middleware.js.map +1 -0
- package/dist/compiler/server/middleware.test.js +32 -0
- package/dist/compiler/server/middleware.test.js.map +1 -0
- package/dist/compiler/server/type.js +1 -0
- package/dist/compiler/server/type.js.map +1 -0
- package/dist/compiler/types.js +1 -0
- package/dist/compiler/types.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/services/account/index.js +1 -0
- package/dist/services/account/index.js.map +1 -0
- package/dist/services/codegen/escape.js +1 -0
- package/dist/services/codegen/escape.js.map +1 -0
- package/dist/services/codegen/quotes.js +1 -0
- package/dist/services/codegen/quotes.js.map +1 -0
- package/dist/services/env-variables/create-index-file.js +1 -0
- package/dist/services/env-variables/create-index-file.js.map +1 -0
- package/dist/services/env-variables/index.js +2 -1
- package/dist/services/env-variables/index.js.map +1 -0
- package/dist/services/environment/package.js +1 -0
- package/dist/services/environment/package.js.map +1 -0
- package/dist/services/environment/package.test.js +1 -0
- package/dist/services/environment/package.test.js.map +1 -0
- package/dist/services/error-handling.js +1 -0
- package/dist/services/error-handling.js.map +1 -0
- package/dist/services/error-handling.test.js +1 -0
- package/dist/services/error-handling.test.js.map +1 -0
- package/dist/services/file-handling/exists.js +1 -0
- package/dist/services/file-handling/exists.js.map +1 -0
- package/dist/services/file-handling/exists.test.js +1 -0
- package/dist/services/file-handling/exists.test.js.map +1 -0
- package/dist/services/file-handling/types.js +1 -0
- package/dist/services/file-handling/types.js.map +1 -0
- package/dist/services/file-handling/write-output.js +1 -0
- package/dist/services/file-handling/write-output.js.map +1 -0
- package/dist/services/file-handling/write-output.test.js +1 -0
- package/dist/services/file-handling/write-output.test.js.map +1 -0
- package/dist/services/file-watching/tracked-fs.d.ts +26 -0
- package/dist/services/file-watching/tracked-fs.d.ts.map +1 -0
- package/dist/services/file-watching/tracked-fs.js +92 -0
- package/dist/services/file-watching/tracked-fs.js.map +1 -0
- package/dist/services/file-watching/tracked-fs.test.d.ts +2 -0
- package/dist/services/file-watching/tracked-fs.test.d.ts.map +1 -0
- package/dist/services/file-watching/tracked-fs.test.js +90 -0
- package/dist/services/file-watching/tracked-fs.test.js.map +1 -0
- package/dist/services/logger/index.js +1 -0
- package/dist/services/logger/index.js.map +1 -0
- package/dist/services/lookup.js +1 -0
- package/dist/services/lookup.js.map +1 -0
- package/dist/services/telemetry/capture.js +1 -0
- package/dist/services/telemetry/capture.js.map +1 -0
- package/dist/services/telemetry/capture.test.js +1 -0
- package/dist/services/telemetry/capture.test.js.map +1 -0
- package/dist/services/telemetry/stack-detection.js +1 -0
- package/dist/services/telemetry/stack-detection.js.map +1 -0
- package/dist/services/telemetry/stack-detection.test.js +1 -0
- package/dist/services/telemetry/stack-detection.test.js.map +1 -0
- package/dist/urlpattern-polyfill/index.js +1 -0
- package/dist/urlpattern-polyfill/index.js.map +1 -0
- package/dist/utilities/detect-json-formatting.js +1 -0
- package/dist/utilities/detect-json-formatting.js.map +1 -0
- package/dist/utilities/node-normalize-path.js +1 -0
- package/dist/utilities/node-normalize-path.js.map +1 -0
- package/package.json +17 -8
package/README.md
CHANGED
|
@@ -1,14 +1,193 @@
|
|
|
1
|
-
[](https://inlang.com)
|
|
2
|
-
|
|
3
1
|
[](https://www.npmjs.com/package/@inlang/paraglide-js)
|
|
4
|
-
[](https://github.com/opral/paraglide-js/issues)
|
|
3
|
+
[](https://github.com/opral/paraglide-js/graphs/contributors)
|
|
4
|
+
[](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>
|
|
24
|
+
<a href="https://idealista.com"><img src="https://www.google.com/s2/favicons?domain=idealista.com&sz=32" alt="Idealista" height="24" /></a>
|
|
25
|
+
<a href="https://architonic.com"><img src="https://www.google.com/s2/favicons?domain=architonic.com&sz=32" alt="Architonic" height="24" /></a>
|
|
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>
|
|
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
|
-
|
|
107
|
+
```
|
|
108
|
+
┌────────────────┐ ┌────────────────────┐ ┌──────────────────────────┐
|
|
109
|
+
│ Inlang Project │ ───▶ │ Paraglide Compiler │ ───▶ │ ./paraglide/messages.js │
|
|
110
|
+
└────────────────┘ └────────────────────┘ │ ./paraglide/runtime.js │
|
|
111
|
+
└──────────────────────────┘
|
|
112
|
+
```
|
|
9
113
|
|
|
10
|
-
|
|
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
|
-
|
|
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)
|
|
@@ -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"}
|
|
@@ -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"}
|
|
@@ -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("
|
|
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,
|
|
1
|
+
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/rollup.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,mHAAsC,CAAC"}
|
|
@@ -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) =>
|
|
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,
|
|
1
|
+
{"version":3,"file":"rspack.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/rspack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,0EAAsC,CAAC"}
|
|
@@ -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;
|
|
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
|
|
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:
|
|
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
|
-
|
|
45
|
-
|
|
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
|
|
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
|
-
|
|
74
|
+
clearReadFiles();
|
|
64
75
|
previousCompilation = await compile({
|
|
65
|
-
fs:
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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;AACH,IAAI,QAA4B,CAAC;AAEjC,IAAI,mBAAkD,CAAC;AACvD,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EA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CAAC;AAEH,IAAI,CAAC,iEAAiE,EAAE,KAAK,IAAI,EAAE;IAClF,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;IAErC,wDAAwD;IACxD,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,EAAyC,CAAC;IAE7D,MAAM,MAAM,GAAG,mBAAmB,CAAC;QAClC,OAAO,EAAE,8BAA8B;QACvC,MAAM,EAAE,cAAc;QACtB,EAAE,EAAE,EAAE;KACN,CAAQ,CAAC;IAEV,MAAM,WAAW,GAAG;QACnB,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;KACtB,CAAC;IAEF,0DAA0D;IAC1D,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;AAC7E,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;IACzE,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC;IAEpC,wDAAwD;IACxD,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC,EAAyC,CAAC;IAE7D,MAAM,MAAM,GAAG,mBAAmB,CAAC;QAClC,OAAO,EAAE,8BAA8B;QACvC,MAAM,EAAE,cAAc;QACtB,EAAE,EAAE,EAAE;KACN,CAAQ,CAAC;IAEV,MAAM,WAAW,GAAG;QACnB,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;KACtB,CAAC;IAEF,8CAA8C;IAC9C,MAAM,MAAM,CAAC,MAAM,CAAC,UAAU,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("
|
|
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,+
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/vite.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,+GAAoC,CAAC"}
|
|
@@ -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) =>
|
|
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,
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../src/bundler-plugins/webpack.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,2EAAuC,CAAC"}
|
|
@@ -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;
|
|
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"}
|