@weglot/translate-react 0.0.0-stage → 0.1.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 (292) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +6 -0
  3. package/README.md +190 -2
  4. package/build/_virtual/rolldown_runtime.cjs +29 -0
  5. package/build/_virtual/rolldown_runtime.mjs +7 -0
  6. package/build/index.cjs +0 -0
  7. package/build/index.d.cts +2 -0
  8. package/build/index.d.mts +2 -0
  9. package/build/index.mjs +1 -0
  10. package/build/locale.d.cts +6 -0
  11. package/build/locale.d.cts.map +1 -0
  12. package/build/locale.d.mts +6 -0
  13. package/build/locale.d.mts.map +1 -0
  14. package/build/metadata/manager.cjs +119 -0
  15. package/build/metadata/manager.mjs +114 -0
  16. package/build/metadata/manager.mjs.map +1 -0
  17. package/build/plugin/build-translator.cjs +207 -0
  18. package/build/plugin/build-translator.mjs +205 -0
  19. package/build/plugin/build-translator.mjs.map +1 -0
  20. package/build/plugin/cleanup.cjs +20 -0
  21. package/build/plugin/cleanup.mjs +20 -0
  22. package/build/plugin/cleanup.mjs.map +1 -0
  23. package/build/plugin/index.cjs +0 -0
  24. package/build/plugin/index.d.cts +2 -0
  25. package/build/plugin/index.d.mts +2 -0
  26. package/build/plugin/index.mjs +1 -0
  27. package/build/plugin/next-compiler-loader.cjs +40 -0
  28. package/build/plugin/next-compiler-loader.d.cts +12 -0
  29. package/build/plugin/next-compiler-loader.d.cts.map +1 -0
  30. package/build/plugin/next-compiler-loader.d.mts +13 -0
  31. package/build/plugin/next-compiler-loader.d.mts.map +1 -0
  32. package/build/plugin/next-compiler-loader.mjs +41 -0
  33. package/build/plugin/next-compiler-loader.mjs.map +1 -0
  34. package/build/plugin/next-config-loader.cjs +13 -0
  35. package/build/plugin/next-config-loader.d.cts +8 -0
  36. package/build/plugin/next-config-loader.d.cts.map +1 -0
  37. package/build/plugin/next-config-loader.d.mts +9 -0
  38. package/build/plugin/next-config-loader.d.mts.map +1 -0
  39. package/build/plugin/next-config-loader.mjs +14 -0
  40. package/build/plugin/next-config-loader.mjs.map +1 -0
  41. package/build/plugin/next-locale-client-loader.cjs +9 -0
  42. package/build/plugin/next-locale-client-loader.d.cts +8 -0
  43. package/build/plugin/next-locale-client-loader.d.cts.map +1 -0
  44. package/build/plugin/next-locale-client-loader.d.mts +9 -0
  45. package/build/plugin/next-locale-client-loader.d.mts.map +1 -0
  46. package/build/plugin/next-locale-client-loader.mjs +10 -0
  47. package/build/plugin/next-locale-client-loader.mjs.map +1 -0
  48. package/build/plugin/next-locale-server-loader.cjs +9 -0
  49. package/build/plugin/next-locale-server-loader.d.cts +8 -0
  50. package/build/plugin/next-locale-server-loader.d.cts.map +1 -0
  51. package/build/plugin/next-locale-server-loader.d.mts +9 -0
  52. package/build/plugin/next-locale-server-loader.d.mts.map +1 -0
  53. package/build/plugin/next-locale-server-loader.mjs +10 -0
  54. package/build/plugin/next-locale-server-loader.mjs.map +1 -0
  55. package/build/plugin/next.cjs +226 -0
  56. package/build/plugin/next.d.cts +9 -0
  57. package/build/plugin/next.d.cts.map +1 -0
  58. package/build/plugin/next.d.mts +9 -0
  59. package/build/plugin/next.d.mts.map +1 -0
  60. package/build/plugin/next.mjs +228 -0
  61. package/build/plugin/next.mjs.map +1 -0
  62. package/build/plugin/transform/babel-compat.cjs +13 -0
  63. package/build/plugin/transform/babel-compat.mjs +10 -0
  64. package/build/plugin/transform/babel-compat.mjs.map +1 -0
  65. package/build/plugin/transform/expression-strings.cjs +145 -0
  66. package/build/plugin/transform/expression-strings.mjs +140 -0
  67. package/build/plugin/transform/expression-strings.mjs.map +1 -0
  68. package/build/plugin/transform/index.cjs +45 -0
  69. package/build/plugin/transform/index.mjs +43 -0
  70. package/build/plugin/transform/index.mjs.map +1 -0
  71. package/build/plugin/transform/metadata.cjs +142 -0
  72. package/build/plugin/transform/metadata.mjs +141 -0
  73. package/build/plugin/transform/metadata.mjs.map +1 -0
  74. package/build/plugin/transform/process-file.cjs +525 -0
  75. package/build/plugin/transform/process-file.mjs +524 -0
  76. package/build/plugin/transform/process-file.mjs.map +1 -0
  77. package/build/plugin/transform/use-i18n.cjs +8 -0
  78. package/build/plugin/transform/use-i18n.mjs +7 -0
  79. package/build/plugin/transform/use-i18n.mjs.map +1 -0
  80. package/build/plugin/transform/utils.cjs +237 -0
  81. package/build/plugin/transform/utils.mjs +219 -0
  82. package/build/plugin/transform/utils.mjs.map +1 -0
  83. package/build/plugin/unplugin.cjs +188 -0
  84. package/build/plugin/unplugin.d.cts +8 -0
  85. package/build/plugin/unplugin.d.cts.map +1 -0
  86. package/build/plugin/unplugin.d.mts +8 -0
  87. package/build/plugin/unplugin.d.mts.map +1 -0
  88. package/build/plugin/unplugin.mjs +188 -0
  89. package/build/plugin/unplugin.mjs.map +1 -0
  90. package/build/plugin/vite.cjs +27 -0
  91. package/build/plugin/vite.d.cts +9 -0
  92. package/build/plugin/vite.d.cts.map +1 -0
  93. package/build/plugin/vite.d.mts +9 -0
  94. package/build/plugin/vite.d.mts.map +1 -0
  95. package/build/plugin/vite.mjs +28 -0
  96. package/build/plugin/vite.mjs.map +1 -0
  97. package/build/plugin/webpack.cjs +26 -0
  98. package/build/plugin/webpack.d.cts +8 -0
  99. package/build/plugin/webpack.d.cts.map +1 -0
  100. package/build/plugin/webpack.d.mts +8 -0
  101. package/build/plugin/webpack.d.mts.map +1 -0
  102. package/build/plugin/webpack.mjs +27 -0
  103. package/build/plugin/webpack.mjs.map +1 -0
  104. package/build/react/client/index.cjs +9 -0
  105. package/build/react/client/index.d.cts +5 -0
  106. package/build/react/client/index.d.mts +5 -0
  107. package/build/react/client/index.mjs +6 -0
  108. package/build/react/client/useTranslation.cjs +71 -0
  109. package/build/react/client/useTranslation.d.cts +42 -0
  110. package/build/react/client/useTranslation.d.cts.map +1 -0
  111. package/build/react/client/useTranslation.d.mts +42 -0
  112. package/build/react/client/useTranslation.d.mts.map +1 -0
  113. package/build/react/client/useTranslation.mjs +71 -0
  114. package/build/react/client/useTranslation.mjs.map +1 -0
  115. package/build/react/next/client.cjs +25 -0
  116. package/build/react/next/client.d.cts +9 -0
  117. package/build/react/next/client.d.cts.map +1 -0
  118. package/build/react/next/client.d.mts +9 -0
  119. package/build/react/next/client.d.mts.map +1 -0
  120. package/build/react/next/client.mjs +24 -0
  121. package/build/react/next/client.mjs.map +1 -0
  122. package/build/react/next/cookie-locale-resolver.cjs +29 -0
  123. package/build/react/next/cookie-locale-resolver.d.cts +33 -0
  124. package/build/react/next/cookie-locale-resolver.d.cts.map +1 -0
  125. package/build/react/next/cookie-locale-resolver.d.mts +33 -0
  126. package/build/react/next/cookie-locale-resolver.d.mts.map +1 -0
  127. package/build/react/next/cookie-locale-resolver.mjs +29 -0
  128. package/build/react/next/cookie-locale-resolver.mjs.map +1 -0
  129. package/build/react/next/server.cjs +21 -0
  130. package/build/react/next/server.d.cts +13 -0
  131. package/build/react/next/server.d.cts.map +1 -0
  132. package/build/react/next/server.d.mts +14 -0
  133. package/build/react/next/server.d.mts.map +1 -0
  134. package/build/react/next/server.mjs +20 -0
  135. package/build/react/next/server.mjs.map +1 -0
  136. package/build/react/server/ServerWeglotProvider.cjs +19 -0
  137. package/build/react/server/ServerWeglotProvider.d.cts +12 -0
  138. package/build/react/server/ServerWeglotProvider.d.cts.map +1 -0
  139. package/build/react/server/ServerWeglotProvider.d.mts +12 -0
  140. package/build/react/server/ServerWeglotProvider.d.mts.map +1 -0
  141. package/build/react/server/ServerWeglotProvider.mjs +19 -0
  142. package/build/react/server/ServerWeglotProvider.mjs.map +1 -0
  143. package/build/react/server/index.cjs +7 -0
  144. package/build/react/server/index.d.cts +4 -0
  145. package/build/react/server/index.d.mts +4 -0
  146. package/build/react/server/index.mjs +5 -0
  147. package/build/react/server/useTranslation.cjs +60 -0
  148. package/build/react/server/useTranslation.d.cts +36 -0
  149. package/build/react/server/useTranslation.d.cts.map +1 -0
  150. package/build/react/server/useTranslation.d.mts +36 -0
  151. package/build/react/server/useTranslation.d.mts.map +1 -0
  152. package/build/react/server/useTranslation.mjs +60 -0
  153. package/build/react/server/useTranslation.mjs.map +1 -0
  154. package/build/react/server-only/index.cjs +42 -0
  155. package/build/react/server-only/index.d.cts +38 -0
  156. package/build/react/server-only/index.d.cts.map +1 -0
  157. package/build/react/server-only/index.d.mts +38 -0
  158. package/build/react/server-only/index.d.mts.map +1 -0
  159. package/build/react/server-only/index.mjs +42 -0
  160. package/build/react/server-only/index.mjs.map +1 -0
  161. package/build/react/server-only/translations.cjs +86 -0
  162. package/build/react/server-only/translations.mjs +86 -0
  163. package/build/react/server-only/translations.mjs.map +1 -0
  164. package/build/react/shared/LocaleSwitcher.cjs +61 -0
  165. package/build/react/shared/LocaleSwitcher.d.cts +71 -0
  166. package/build/react/shared/LocaleSwitcher.d.cts.map +1 -0
  167. package/build/react/shared/LocaleSwitcher.d.mts +71 -0
  168. package/build/react/shared/LocaleSwitcher.d.mts.map +1 -0
  169. package/build/react/shared/LocaleSwitcher.mjs +61 -0
  170. package/build/react/shared/LocaleSwitcher.mjs.map +1 -0
  171. package/build/react/shared/WeglotContext.cjs +14 -0
  172. package/build/react/shared/WeglotContext.d.cts +34 -0
  173. package/build/react/shared/WeglotContext.d.cts.map +1 -0
  174. package/build/react/shared/WeglotContext.d.mts +34 -0
  175. package/build/react/shared/WeglotContext.d.mts.map +1 -0
  176. package/build/react/shared/WeglotContext.mjs +13 -0
  177. package/build/react/shared/WeglotContext.mjs.map +1 -0
  178. package/build/react/shared/WeglotProvider.cjs +250 -0
  179. package/build/react/shared/WeglotProvider.d.cts +60 -0
  180. package/build/react/shared/WeglotProvider.d.cts.map +1 -0
  181. package/build/react/shared/WeglotProvider.d.mts +60 -0
  182. package/build/react/shared/WeglotProvider.d.mts.map +1 -0
  183. package/build/react/shared/WeglotProvider.mjs +250 -0
  184. package/build/react/shared/WeglotProvider.mjs.map +1 -0
  185. package/build/react/shared/render-rich-text.cjs +56 -0
  186. package/build/react/shared/render-rich-text.d.cts +16 -0
  187. package/build/react/shared/render-rich-text.d.cts.map +1 -0
  188. package/build/react/shared/render-rich-text.d.mts +16 -0
  189. package/build/react/shared/render-rich-text.d.mts.map +1 -0
  190. package/build/react/shared/render-rich-text.mjs +55 -0
  191. package/build/react/shared/render-rich-text.mjs.map +1 -0
  192. package/build/react/shared/utils.cjs +34 -0
  193. package/build/react/shared/utils.mjs +35 -0
  194. package/build/react/shared/utils.mjs.map +1 -0
  195. package/build/react/types.d.cts +16 -0
  196. package/build/react/types.d.cts.map +1 -0
  197. package/build/react/types.d.mts +16 -0
  198. package/build/react/types.d.mts.map +1 -0
  199. package/build/runtime/html/segmenter.cjs +226 -0
  200. package/build/runtime/html/segmenter.mjs +225 -0
  201. package/build/runtime/html/segmenter.mjs.map +1 -0
  202. package/build/runtime/index.cjs +6 -0
  203. package/build/runtime/index.d.cts +2 -0
  204. package/build/runtime/index.d.mts +2 -0
  205. package/build/runtime/index.mjs +3 -0
  206. package/build/runtime/translate-dynamic.cjs +142 -0
  207. package/build/runtime/translate-dynamic.d.cts +29 -0
  208. package/build/runtime/translate-dynamic.d.cts.map +1 -0
  209. package/build/runtime/translate-dynamic.d.mts +29 -0
  210. package/build/runtime/translate-dynamic.d.mts.map +1 -0
  211. package/build/runtime/translate-dynamic.mjs +139 -0
  212. package/build/runtime/translate-dynamic.mjs.map +1 -0
  213. package/build/translation-server/logger.cjs +37 -0
  214. package/build/translation-server/logger.mjs +37 -0
  215. package/build/translation-server/logger.mjs.map +1 -0
  216. package/build/translation-server/translation-server.cjs +451 -0
  217. package/build/translation-server/translation-server.mjs +448 -0
  218. package/build/translation-server/translation-server.mjs.map +1 -0
  219. package/build/translators/api.cjs +12 -0
  220. package/build/translators/api.mjs +12 -0
  221. package/build/translators/api.mjs.map +1 -0
  222. package/build/translators/cache-factory.cjs +26 -0
  223. package/build/translators/cache-factory.mjs +27 -0
  224. package/build/translators/cache-factory.mjs.map +1 -0
  225. package/build/translators/local-cache.cjs +132 -0
  226. package/build/translators/local-cache.mjs +130 -0
  227. package/build/translators/local-cache.mjs.map +1 -0
  228. package/build/translators/translation-service.cjs +137 -0
  229. package/build/translators/translation-service.mjs +138 -0
  230. package/build/translators/translation-service.mjs.map +1 -0
  231. package/build/translators/weglot/api-client.cjs +79 -0
  232. package/build/translators/weglot/api-client.mjs +79 -0
  233. package/build/translators/weglot/api-client.mjs.map +1 -0
  234. package/build/translators/weglot/definitions/definitions.generated.cjs +53 -0
  235. package/build/translators/weglot/definitions/definitions.generated.mjs +52 -0
  236. package/build/translators/weglot/definitions/definitions.generated.mjs.map +1 -0
  237. package/build/translators/weglot/engine.cjs +46 -0
  238. package/build/translators/weglot/engine.mjs +43 -0
  239. package/build/translators/weglot/engine.mjs.map +1 -0
  240. package/build/translators/weglot/translator.cjs +61 -0
  241. package/build/translators/weglot/translator.mjs +62 -0
  242. package/build/translators/weglot/translator.mjs.map +1 -0
  243. package/build/translators/weglot/wire-format.cjs +128 -0
  244. package/build/translators/weglot/wire-format.mjs +129 -0
  245. package/build/translators/weglot/wire-format.mjs.map +1 -0
  246. package/build/types.d.cts +143 -0
  247. package/build/types.d.cts.map +1 -0
  248. package/build/types.d.mts +143 -0
  249. package/build/types.d.mts.map +1 -0
  250. package/build/utils/config-factory.cjs +86 -0
  251. package/build/utils/config-factory.mjs +83 -0
  252. package/build/utils/config-factory.mjs.map +1 -0
  253. package/build/utils/hash.cjs +17 -0
  254. package/build/utils/hash.mjs +16 -0
  255. package/build/utils/hash.mjs.map +1 -0
  256. package/build/utils/is-valid-locale.cjs +13 -0
  257. package/build/utils/is-valid-locale.mjs +13 -0
  258. package/build/utils/is-valid-locale.mjs.map +1 -0
  259. package/build/utils/logger.cjs +51 -0
  260. package/build/utils/logger.mjs +50 -0
  261. package/build/utils/logger.mjs.map +1 -0
  262. package/build/utils/path-helpers.cjs +49 -0
  263. package/build/utils/path-helpers.mjs +47 -0
  264. package/build/utils/path-helpers.mjs.map +1 -0
  265. package/build/utils/timeout.cjs +42 -0
  266. package/build/utils/timeout.mjs +41 -0
  267. package/build/utils/timeout.mjs.map +1 -0
  268. package/build/virtual/code-generator.cjs +56 -0
  269. package/build/virtual/code-generator.mjs +55 -0
  270. package/build/virtual/code-generator.mjs.map +1 -0
  271. package/build/virtual/config.cjs +16 -0
  272. package/build/virtual/config.d.cts +13 -0
  273. package/build/virtual/config.d.cts.map +1 -0
  274. package/build/virtual/config.d.mts +13 -0
  275. package/build/virtual/config.d.mts.map +1 -0
  276. package/build/virtual/config.mjs +12 -0
  277. package/build/virtual/config.mjs.map +1 -0
  278. package/build/virtual/locale/client.cjs +23 -0
  279. package/build/virtual/locale/client.d.cts +19 -0
  280. package/build/virtual/locale/client.d.cts.map +1 -0
  281. package/build/virtual/locale/client.d.mts +19 -0
  282. package/build/virtual/locale/client.d.mts.map +1 -0
  283. package/build/virtual/locale/client.mjs +22 -0
  284. package/build/virtual/locale/client.mjs.map +1 -0
  285. package/build/virtual/locale/server.cjs +13 -0
  286. package/build/virtual/locale/server.d.cts +13 -0
  287. package/build/virtual/locale/server.d.cts.map +1 -0
  288. package/build/virtual/locale/server.d.mts +13 -0
  289. package/build/virtual/locale/server.d.mts.map +1 -0
  290. package/build/virtual/locale/server.mjs +13 -0
  291. package/build/virtual/locale/server.mjs.map +1 -0
  292. package/package.json +260 -4
@@ -0,0 +1,40 @@
1
+ const require_logger = require('../utils/logger.cjs');
2
+ const require_manager = require('../metadata/manager.cjs');
3
+ const require_index = require('./transform/index.cjs');
4
+
5
+ //#region src/plugin/next-compiler-loader.ts
6
+ /**
7
+ * Turbopack/Webpack loader for automatic translation
8
+ *
9
+ * This loader transforms React components to inject translation calls automatically.
10
+ *
11
+ * For production builds, translations are generated after compilation completes
12
+ * via Next.js's runAfterProductionCompile hook (see next.ts plugin).
13
+ */
14
+ async function nextCompilerLoader(source) {
15
+ if (typeof this.async !== "function") throw new Error("This module must be run as a loader");
16
+ const callback = this.async();
17
+ try {
18
+ const config = this.getOptions();
19
+ require_logger.logger.debug(`[Turbopack Loader] Processing: ${this.resourcePath}`);
20
+ const result = require_index.transformComponent({
21
+ code: source,
22
+ filePath: this.resourcePath,
23
+ config
24
+ });
25
+ if (!result.transformed) return callback(null, source);
26
+ if (result.newEntries && result.newEntries.length > 0) {
27
+ await require_manager.saveMetadata(config.metadataFilePath, result.newEntries, config.environment !== "development");
28
+ require_logger.logger.debug(`[Turbopack Loader] Found ${result.newEntries.length} translatable text(s) in ${this.resourcePath}`);
29
+ }
30
+ const validMap = result.map && result.map.sources && Array.isArray(result.map.sources) && result.map.sources.every((s) => typeof s === "string") ? result.map : void 0;
31
+ callback(null, result.code, validMap);
32
+ } catch (error) {
33
+ require_logger.logger.error(`Compiler failed for ${this.resourcePath}:`);
34
+ require_logger.logger.error("Details:", error, typeof error === "object" && error && "message" in error ? error.message : error, error instanceof Error ? error.stack : void 0);
35
+ callback(error);
36
+ }
37
+ }
38
+
39
+ //#endregion
40
+ module.exports = nextCompilerLoader;
@@ -0,0 +1,12 @@
1
+ //#region src/plugin/next-compiler-loader.d.ts
2
+ /**
3
+ * Turbopack/Webpack loader for automatic translation
4
+ *
5
+ * This loader transforms React components to inject translation calls automatically.
6
+ *
7
+ * For production builds, translations are generated after compilation completes
8
+ * via Next.js's runAfterProductionCompile hook (see next.ts plugin).
9
+ */
10
+ declare function nextCompilerLoader(this: any, source: string): Promise<void>;
11
+ export = nextCompilerLoader;
12
+ //# sourceMappingURL=next-compiler-loader.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-compiler-loader.d.cts","names":[],"sources":["../../src/plugin/next-compiler-loader.ts"],"sourcesContent":[],"mappings":";;;;;;;;;iBAa8B,kBAAA,6BAG3B"}
@@ -0,0 +1,13 @@
1
+ //#region src/plugin/next-compiler-loader.d.ts
2
+ /**
3
+ * Turbopack/Webpack loader for automatic translation
4
+ *
5
+ * This loader transforms React components to inject translation calls automatically.
6
+ *
7
+ * For production builds, translations are generated after compilation completes
8
+ * via Next.js's runAfterProductionCompile hook (see next.ts plugin).
9
+ */
10
+ declare function nextCompilerLoader(this: any, source: string): Promise<void>;
11
+ //#endregion
12
+ export { nextCompilerLoader as default };
13
+ //# sourceMappingURL=next-compiler-loader.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-compiler-loader.d.mts","names":[],"sources":["../../src/plugin/next-compiler-loader.ts"],"sourcesContent":[],"mappings":";;;;;;;;;iBAa8B,kBAAA,6BAG3B"}
@@ -0,0 +1,41 @@
1
+ import { logger } from "../utils/logger.mjs";
2
+ import { saveMetadata } from "../metadata/manager.mjs";
3
+ import { transformComponent } from "./transform/index.mjs";
4
+
5
+ //#region src/plugin/next-compiler-loader.ts
6
+ /**
7
+ * Turbopack/Webpack loader for automatic translation
8
+ *
9
+ * This loader transforms React components to inject translation calls automatically.
10
+ *
11
+ * For production builds, translations are generated after compilation completes
12
+ * via Next.js's runAfterProductionCompile hook (see next.ts plugin).
13
+ */
14
+ async function nextCompilerLoader(source) {
15
+ if (typeof this.async !== "function") throw new Error("This module must be run as a loader");
16
+ const callback = this.async();
17
+ try {
18
+ const config = this.getOptions();
19
+ logger.debug(`[Turbopack Loader] Processing: ${this.resourcePath}`);
20
+ const result = transformComponent({
21
+ code: source,
22
+ filePath: this.resourcePath,
23
+ config
24
+ });
25
+ if (!result.transformed) return callback(null, source);
26
+ if (result.newEntries && result.newEntries.length > 0) {
27
+ await saveMetadata(config.metadataFilePath, result.newEntries, config.environment !== "development");
28
+ logger.debug(`[Turbopack Loader] Found ${result.newEntries.length} translatable text(s) in ${this.resourcePath}`);
29
+ }
30
+ const validMap = result.map && result.map.sources && Array.isArray(result.map.sources) && result.map.sources.every((s) => typeof s === "string") ? result.map : void 0;
31
+ callback(null, result.code, validMap);
32
+ } catch (error) {
33
+ logger.error(`Compiler failed for ${this.resourcePath}:`);
34
+ logger.error("Details:", error, typeof error === "object" && error && "message" in error ? error.message : error, error instanceof Error ? error.stack : void 0);
35
+ callback(error);
36
+ }
37
+ }
38
+
39
+ //#endregion
40
+ export { nextCompilerLoader as default };
41
+ //# sourceMappingURL=next-compiler-loader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-compiler-loader.mjs","names":["config: WeglotConfig & { metadataFilePath: string }"],"sources":["../../src/plugin/next-compiler-loader.ts"],"sourcesContent":["import type { WeglotConfig } from \"../types\";\nimport { transformComponent } from \"./transform\";\nimport { logger } from \"../utils/logger\";\nimport { saveMetadata } from \"../metadata/manager\";\n\n/**\n * Turbopack/Webpack loader for automatic translation\n *\n * This loader transforms React components to inject translation calls automatically.\n *\n * For production builds, translations are generated after compilation completes\n * via Next.js's runAfterProductionCompile hook (see next.ts plugin).\n */\nexport default async function nextCompilerLoader(\n this: any,\n source: string,\n): Promise<void> {\n // TODO (AleksandrSl 14/12/2025): Webpack doesn't like callback usage in async function.\n // But async function can return only code, so we have to use promises which is sad. It actually errors only when we catch an error, so it's not an urgent problem\n\n // Ensure we're running in loader context\n if (typeof this.async !== \"function\") {\n throw new Error(\"This module must be run as a loader\");\n }\n const callback = this.async();\n\n try {\n const config: WeglotConfig & { metadataFilePath: string } =\n this.getOptions();\n\n logger.debug(`[Turbopack Loader] Processing: ${this.resourcePath}`);\n\n // Transform the component\n const result = transformComponent({\n code: source,\n filePath: this.resourcePath,\n config,\n });\n\n // If no transformation occurred, return original source\n if (!result.transformed) {\n return callback(null, source);\n }\n\n // Update metadata with new entries\n if (result.newEntries && result.newEntries.length > 0) {\n await saveMetadata(\n config.metadataFilePath,\n result.newEntries,\n config.environment !== \"development\",\n );\n\n logger.debug(\n `[Turbopack Loader] Found ${result.newEntries.length} translatable text(s) in ${this.resourcePath}`,\n );\n }\n\n // Validate source map before passing to webpack\n // Webpack crashes if sources array contains undefined values\n const validMap =\n result.map &&\n result.map.sources &&\n Array.isArray(result.map.sources) &&\n result.map.sources.every((s: any) => typeof s === \"string\")\n ? result.map\n : undefined;\n\n callback(null, result.code, validMap);\n } catch (error) {\n logger.error(`Compiler failed for ${this.resourcePath}:`);\n logger.error(\n \"Details:\",\n error,\n typeof error === \"object\" && error && \"message\" in error\n ? error.message\n : error,\n error instanceof Error ? error.stack : undefined,\n );\n callback(error as Error);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,eAA8B,mBAE5B,QACe;AAKf,KAAI,OAAO,KAAK,UAAU,WACxB,OAAM,IAAI,MAAM,sCAAsC;CAExD,MAAM,WAAW,KAAK,OAAO;AAE7B,KAAI;EACF,MAAMA,SACJ,KAAK,YAAY;AAEnB,SAAO,MAAM,kCAAkC,KAAK,eAAe;EAGnE,MAAM,SAAS,mBAAmB;GAChC,MAAM;GACN,UAAU,KAAK;GACf;GACD,CAAC;AAGF,MAAI,CAAC,OAAO,YACV,QAAO,SAAS,MAAM,OAAO;AAI/B,MAAI,OAAO,cAAc,OAAO,WAAW,SAAS,GAAG;AACrD,SAAM,aACJ,OAAO,kBACP,OAAO,YACP,OAAO,gBAAgB,cACxB;AAED,UAAO,MACL,4BAA4B,OAAO,WAAW,OAAO,2BAA2B,KAAK,eACtF;;EAKH,MAAM,WACJ,OAAO,OACP,OAAO,IAAI,WACX,MAAM,QAAQ,OAAO,IAAI,QAAQ,IACjC,OAAO,IAAI,QAAQ,OAAO,MAAW,OAAO,MAAM,SAAS,GACvD,OAAO,MACP;AAEN,WAAS,MAAM,OAAO,MAAM,SAAS;UAC9B,OAAO;AACd,SAAO,MAAM,uBAAuB,KAAK,aAAa,GAAG;AACzD,SAAO,MACL,YACA,OACA,OAAO,UAAU,YAAY,SAAS,aAAa,QAC/C,MAAM,UACN,OACJ,iBAAiB,QAAQ,MAAM,QAAQ,OACxC;AACD,WAAS,MAAe"}
@@ -0,0 +1,13 @@
1
+ const require_code_generator = require('../virtual/code-generator.cjs');
2
+
3
+ //#region src/plugin/next-config-loader.ts
4
+ /**
5
+ * Loader for config module
6
+ * Generates full module code - ignores source file (template is only for types)
7
+ */
8
+ function nextConfigLoader(_source) {
9
+ return require_code_generator.generateConfigModule(this.getOptions());
10
+ }
11
+
12
+ //#endregion
13
+ module.exports = nextConfigLoader;
@@ -0,0 +1,8 @@
1
+ //#region src/plugin/next-config-loader.d.ts
2
+ /**
3
+ * Loader for config module
4
+ * Generates full module code - ignores source file (template is only for types)
5
+ */
6
+ declare function nextConfigLoader(this: any, _source: string): string;
7
+ export = nextConfigLoader;
8
+ //# sourceMappingURL=next-config-loader.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-config-loader.d.cts","names":[],"sources":["../../src/plugin/next-config-loader.ts"],"sourcesContent":[],"mappings":";;;;;iBAOwB,gBAAA"}
@@ -0,0 +1,9 @@
1
+ //#region src/plugin/next-config-loader.d.ts
2
+ /**
3
+ * Loader for config module
4
+ * Generates full module code - ignores source file (template is only for types)
5
+ */
6
+ declare function nextConfigLoader(this: any, _source: string): string;
7
+ //#endregion
8
+ export { nextConfigLoader as default };
9
+ //# sourceMappingURL=next-config-loader.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-config-loader.d.mts","names":[],"sources":["../../src/plugin/next-config-loader.ts"],"sourcesContent":[],"mappings":";;;;;iBAOwB,gBAAA"}
@@ -0,0 +1,14 @@
1
+ import { generateConfigModule } from "../virtual/code-generator.mjs";
2
+
3
+ //#region src/plugin/next-config-loader.ts
4
+ /**
5
+ * Loader for config module
6
+ * Generates full module code - ignores source file (template is only for types)
7
+ */
8
+ function nextConfigLoader(_source) {
9
+ return generateConfigModule(this.getOptions());
10
+ }
11
+
12
+ //#endregion
13
+ export { nextConfigLoader as default };
14
+ //# sourceMappingURL=next-config-loader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-config-loader.mjs","names":[],"sources":["../../src/plugin/next-config-loader.ts"],"sourcesContent":["import type { WeglotConfig } from \"../types\";\nimport { generateConfigModule } from \"../virtual/code-generator\";\n\n/**\n * Loader for config module\n * Generates full module code - ignores source file (template is only for types)\n */\nexport default function nextConfigLoader(this: any, _source: string): string {\n const config: WeglotConfig = this.getOptions();\n return generateConfigModule(config);\n}\n"],"mappings":";;;;;;;AAOA,SAAwB,iBAA4B,SAAyB;AAE3E,QAAO,qBADsB,KAAK,YAAY,CACX"}
@@ -0,0 +1,9 @@
1
+ const require_code_generator = require('../virtual/code-generator.cjs');
2
+
3
+ //#region src/plugin/next-locale-client-loader.ts
4
+ function nextLocaleClientLoader(_source) {
5
+ return require_code_generator.generateClientLocaleModule(this.getOptions());
6
+ }
7
+
8
+ //#endregion
9
+ module.exports = nextLocaleClientLoader;
@@ -0,0 +1,8 @@
1
+ //#region src/plugin/next-locale-client-loader.d.ts
2
+ /**
3
+ * Loader for locale/client module
4
+ * Generates full module code - ignores source file (template is only for types)
5
+ */
6
+ declare function nextLocaleClientLoader(this: any, _source: string): string;
7
+ export = nextLocaleClientLoader;
8
+ //# sourceMappingURL=next-locale-client-loader.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-locale-client-loader.d.cts","names":[],"sources":["../../src/plugin/next-locale-client-loader.ts"],"sourcesContent":[],"mappings":";;;;;iBAQwB,sBAAA"}
@@ -0,0 +1,9 @@
1
+ //#region src/plugin/next-locale-client-loader.d.ts
2
+ /**
3
+ * Loader for locale/client module
4
+ * Generates full module code - ignores source file (template is only for types)
5
+ */
6
+ declare function nextLocaleClientLoader(this: any, _source: string): string;
7
+ //#endregion
8
+ export { nextLocaleClientLoader as default };
9
+ //# sourceMappingURL=next-locale-client-loader.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-locale-client-loader.d.mts","names":[],"sources":["../../src/plugin/next-locale-client-loader.ts"],"sourcesContent":[],"mappings":";;;;;iBAQwB,sBAAA"}
@@ -0,0 +1,10 @@
1
+ import { generateClientLocaleModule } from "../virtual/code-generator.mjs";
2
+
3
+ //#region src/plugin/next-locale-client-loader.ts
4
+ function nextLocaleClientLoader(_source) {
5
+ return generateClientLocaleModule(this.getOptions());
6
+ }
7
+
8
+ //#endregion
9
+ export { nextLocaleClientLoader as default };
10
+ //# sourceMappingURL=next-locale-client-loader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-locale-client-loader.mjs","names":[],"sources":["../../src/plugin/next-locale-client-loader.ts"],"sourcesContent":["/**\n * Loader for locale/client module\n * Generates full module code - ignores source file (template is only for types)\n */\n\nimport type { WeglotConfig } from \"../types\";\nimport { generateClientLocaleModule } from \"../virtual/code-generator\";\n\nexport default function nextLocaleClientLoader(\n this: any,\n _source: string,\n): string {\n const config: WeglotConfig = this.getOptions();\n return generateClientLocaleModule(config);\n}\n"],"mappings":";;;AAQA,SAAwB,uBAEtB,SACQ;AAER,QAAO,2BADsB,KAAK,YAAY,CACL"}
@@ -0,0 +1,9 @@
1
+ const require_code_generator = require('../virtual/code-generator.cjs');
2
+
3
+ //#region src/plugin/next-locale-server-loader.ts
4
+ function nextLocaleServerLoader(_source) {
5
+ return require_code_generator.generateServerLocaleModule(this.getOptions());
6
+ }
7
+
8
+ //#endregion
9
+ module.exports = nextLocaleServerLoader;
@@ -0,0 +1,8 @@
1
+ //#region src/plugin/next-locale-server-loader.d.ts
2
+ /**
3
+ * Loader for locale/server module
4
+ * Generates full module code - ignores source file (template is only for types)
5
+ */
6
+ declare function nextLocaleServerLoader(this: any, _source: string): string;
7
+ export = nextLocaleServerLoader;
8
+ //# sourceMappingURL=next-locale-server-loader.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-locale-server-loader.d.cts","names":[],"sources":["../../src/plugin/next-locale-server-loader.ts"],"sourcesContent":[],"mappings":";;;;;iBAQwB,sBAAA"}
@@ -0,0 +1,9 @@
1
+ //#region src/plugin/next-locale-server-loader.d.ts
2
+ /**
3
+ * Loader for locale/server module
4
+ * Generates full module code - ignores source file (template is only for types)
5
+ */
6
+ declare function nextLocaleServerLoader(this: any, _source: string): string;
7
+ //#endregion
8
+ export { nextLocaleServerLoader as default };
9
+ //# sourceMappingURL=next-locale-server-loader.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-locale-server-loader.d.mts","names":[],"sources":["../../src/plugin/next-locale-server-loader.ts"],"sourcesContent":[],"mappings":";;;;;iBAQwB,sBAAA"}
@@ -0,0 +1,10 @@
1
+ import { generateServerLocaleModule } from "../virtual/code-generator.mjs";
2
+
3
+ //#region src/plugin/next-locale-server-loader.ts
4
+ function nextLocaleServerLoader(_source) {
5
+ return generateServerLocaleModule(this.getOptions());
6
+ }
7
+
8
+ //#endregion
9
+ export { nextLocaleServerLoader as default };
10
+ //# sourceMappingURL=next-locale-server-loader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next-locale-server-loader.mjs","names":[],"sources":["../../src/plugin/next-locale-server-loader.ts"],"sourcesContent":["/**\n * Loader for locale/server module\n * Generates full module code - ignores source file (template is only for types)\n */\n\nimport type { WeglotConfig } from \"../types\";\nimport { generateServerLocaleModule } from \"../virtual/code-generator\";\n\nexport default function nextLocaleServerLoader(\n this: any,\n _source: string,\n): string {\n const config: WeglotConfig = this.getOptions();\n return generateServerLocaleModule(config);\n}\n"],"mappings":";;;AAQA,SAAwB,uBAEtB,SACQ;AAER,QAAO,2BADsB,KAAK,YAAY,CACL"}
@@ -0,0 +1,226 @@
1
+ const require_logger = require('../utils/logger.cjs');
2
+ const require_config_factory = require('../utils/config-factory.cjs');
3
+ const require_translation_service = require('../translators/translation-service.cjs');
4
+ const require_manager = require('../metadata/manager.cjs');
5
+ const require_translation_server = require('../translation-server/translation-server.cjs');
6
+ const require_build_translator = require('./build-translator.cjs');
7
+ const require_cleanup = require('./cleanup.cjs');
8
+ const require_use_i18n = require('./transform/use-i18n.cjs');
9
+
10
+ //#region src/plugin/next.ts
11
+ function loaders({ weglotConfig, metadataFilePath, translationServerUrl }) {
12
+ const common = {
13
+ sourceRoot: weglotConfig.sourceRoot,
14
+ weglotDir: weglotConfig.weglotDir,
15
+ sourceLocale: weglotConfig.sourceLocale
16
+ };
17
+ const compilerLoader = {
18
+ loader: "@weglot/translate-react/next-compiler-loader",
19
+ options: {
20
+ ...common,
21
+ useDirective: weglotConfig.useDirective,
22
+ translatableAttributes: weglotConfig.translatableAttributes,
23
+ metadataFilePath
24
+ }
25
+ };
26
+ const configLoader = {
27
+ loader: "@weglot/translate-react/next-config-loader",
28
+ options: {
29
+ ...common,
30
+ apiLocales: weglotConfig.apiLocales,
31
+ translationEngine: weglotConfig.translationEngine,
32
+ dev: Object.fromEntries(Object.entries({
33
+ translationServerUrl,
34
+ ...weglotConfig.dev
35
+ }).filter(([, value]) => value !== void 0))
36
+ }
37
+ };
38
+ const localeServerLoader = {
39
+ loader: "@weglot/translate-react/next-locale-server-loader",
40
+ options: {
41
+ ...common,
42
+ localePersistence: weglotConfig.localePersistence
43
+ }
44
+ };
45
+ const localeClientLoader = {
46
+ loader: "@weglot/translate-react/next-locale-client-loader",
47
+ options: {
48
+ ...common,
49
+ localePersistence: weglotConfig.localePersistence
50
+ }
51
+ };
52
+ return {
53
+ compiler: {
54
+ turbopack: {
55
+ pattern: "*.{tsx,jsx}",
56
+ config: {
57
+ condition: { content: weglotConfig.useDirective ? require_use_i18n.useI18nRegex : void 0 },
58
+ loaders: [compilerLoader]
59
+ }
60
+ },
61
+ webpack: {
62
+ enforce: "pre",
63
+ test: /\.(tsx|jsx)$/i,
64
+ exclude: /node_modules/,
65
+ use: [compilerLoader]
66
+ }
67
+ },
68
+ config: {
69
+ turbopack: {
70
+ pattern: "**/virtual/config.mjs",
71
+ config: { loaders: [configLoader] }
72
+ },
73
+ webpack: {
74
+ enforce: "pre",
75
+ test: /virtual\/config\.mjs$/i,
76
+ use: [configLoader]
77
+ }
78
+ },
79
+ localeServer: {
80
+ turbopack: {
81
+ pattern: "**/virtual/locale/server.mjs",
82
+ config: { loaders: [localeServerLoader] }
83
+ },
84
+ webpack: {
85
+ enforce: "pre",
86
+ test: /virtual\/locale[\\/]server\.mjs$/i,
87
+ use: [localeServerLoader]
88
+ }
89
+ },
90
+ localeClient: {
91
+ turbopack: {
92
+ pattern: "**/virtual/locale/client.mjs",
93
+ config: { loaders: [localeClientLoader] }
94
+ },
95
+ webpack: {
96
+ enforce: "pre",
97
+ test: /virtual\/locale[\\/]client\.mjs$/i,
98
+ use: [localeClientLoader]
99
+ }
100
+ }
101
+ };
102
+ }
103
+ /**
104
+ * Check if Next.js supports stable turbopack config (Next.js 16+)
105
+ */
106
+ function hasStableTurboConfig() {
107
+ try {
108
+ const nextPackage = require("next/package.json");
109
+ return parseInt(nextPackage.version.split(".")[0], 10) >= 16;
110
+ } catch {
111
+ return false;
112
+ }
113
+ }
114
+ function getTurbopackConfig(userConfig) {
115
+ return (hasStableTurboConfig() ? userConfig?.turbopack : userConfig?.experimental?.turbo) || {};
116
+ }
117
+ /**
118
+ * Merge Turbopack rules without mutating original
119
+ */
120
+ function mergeTurbopackRules(existingRules, newRules) {
121
+ const mergedRules = { ...existingRules };
122
+ for (const newRule of newRules) {
123
+ if (!newRule) continue;
124
+ const { pattern, config } = newRule;
125
+ if (mergedRules[pattern]) if (Array.isArray(mergedRules[pattern])) mergedRules[pattern] = [...mergedRules[pattern], config];
126
+ else mergedRules[pattern] = [mergedRules[pattern], config];
127
+ else mergedRules[pattern] = config;
128
+ }
129
+ return mergedRules;
130
+ }
131
+ function isMainRunner() {
132
+ return !process.env.NEXT_PRIVATE_BUILD_WORKER && !process.env.IS_NEXT_WORKER && !process.env.NEXT_PRIVATE_WORKER;
133
+ }
134
+ async function withWeglot(nextConfig = {}, weglotOptions) {
135
+ const weglotConfig = require_config_factory.createWeglotConfig(weglotOptions);
136
+ await require_config_factory.resolveProjectLanguages(weglotConfig);
137
+ let metadataFilePath = require_manager.getMetadataPath(weglotConfig);
138
+ const isDev = weglotConfig.environment === "development";
139
+ require_logger.logger.debug(`Initializing Weglot. Is dev mode: ${isDev}. Is main runner: ${isMainRunner()}`);
140
+ if (isDev && !process.env.WEGLOT_TRANSLATION_SERVER_URL) if (weglotConfig.dev.translationServerUrl) {
141
+ require_logger.logger.info(`Using existing translation server URL (${weglotConfig.dev.translationServerUrl}) from config`);
142
+ process.env.WEGLOT_TRANSLATION_SERVER_URL = weglotConfig.dev.translationServerUrl;
143
+ } else {
144
+ const translationServer = await require_translation_server.startOrGetTranslationServer({
145
+ translationService: new require_translation_service.TranslationService(weglotConfig, require_logger.logger),
146
+ onError: (err) => {
147
+ require_logger.logger.error("Translation server error:", err);
148
+ },
149
+ onReady: (port) => {
150
+ require_logger.logger.info(`Translation server started successfully on port: ${port}`);
151
+ },
152
+ config: weglotConfig
153
+ });
154
+ process.env.WEGLOT_TRANSLATION_SERVER_URL = translationServer.url;
155
+ if (translationServer.server) require_cleanup.registerCleanupOnCurrentProcess({ asyncCleanup: async () => {
156
+ await translationServer.server.stop();
157
+ } });
158
+ }
159
+ const translationServerUrl = process.env.WEGLOT_TRANSLATION_SERVER_URL;
160
+ if (isMainRunner()) {
161
+ const environment = weglotConfig.environment;
162
+ require_manager.cleanupMetadataForEnvironment(metadataFilePath, environment);
163
+ require_cleanup.registerCleanupOnCurrentProcess({ cleanup: () => require_manager.cleanupMetadataForEnvironment(metadataFilePath, environment) });
164
+ }
165
+ const existingTurbopackConfig = getTurbopackConfig(nextConfig);
166
+ let mergedRules = mergeTurbopackRules(existingTurbopackConfig.rules ?? {}, Object.values(loaders({
167
+ weglotConfig,
168
+ metadataFilePath,
169
+ translationServerUrl
170
+ })).map((rules) => rules.turbopack));
171
+ const mergedResolveAlias = { ...existingTurbopackConfig.resolveAlias };
172
+ let turbopackConfig;
173
+ if (hasStableTurboConfig()) turbopackConfig = { turbopack: {
174
+ ...nextConfig.turbopack,
175
+ rules: mergedRules,
176
+ resolveAlias: mergedResolveAlias
177
+ } };
178
+ else turbopackConfig = { experimental: {
179
+ ...nextConfig.experimental,
180
+ turbo: {
181
+ ...nextConfig.experimental?.turbo,
182
+ rules: mergedRules,
183
+ resolveAlias: mergedResolveAlias
184
+ }
185
+ } };
186
+ const runAfterProductionCompile = async ({ distDir, projectDir }) => {
187
+ if (typeof nextConfig.compiler?.runAfterProductionCompile === "function") await nextConfig.compiler.runAfterProductionCompile({
188
+ distDir,
189
+ projectDir
190
+ });
191
+ require_logger.logger.info("Running post-build translation generation...");
192
+ try {
193
+ await require_build_translator.processBuildTranslations({
194
+ config: weglotConfig,
195
+ publicOutputPath: distDir,
196
+ metadataFilePath
197
+ });
198
+ } catch (error) {
199
+ require_logger.logger.error("Translation generation failed:", error instanceof Error ? error.message : error);
200
+ throw error;
201
+ }
202
+ };
203
+ const webpack = (config, options) => {
204
+ let modifiedConfig = config;
205
+ if (typeof nextConfig.webpack === "function") modifiedConfig = nextConfig.webpack(config, options);
206
+ const weglotRules = Object.values(loaders({
207
+ weglotConfig,
208
+ metadataFilePath,
209
+ translationServerUrl
210
+ })).map((rules) => rules.webpack).filter(Boolean);
211
+ modifiedConfig.module.rules.unshift(...weglotRules);
212
+ return modifiedConfig;
213
+ };
214
+ return {
215
+ ...nextConfig,
216
+ ...turbopackConfig,
217
+ compiler: {
218
+ ...nextConfig.compiler,
219
+ runAfterProductionCompile
220
+ },
221
+ webpack
222
+ };
223
+ }
224
+
225
+ //#endregion
226
+ exports.withWeglot = withWeglot;
@@ -0,0 +1,9 @@
1
+ import { PartialWeglotConfig } from "../types.cjs";
2
+ import { NextConfig } from "next";
3
+
4
+ //#region src/plugin/next.d.ts
5
+ type WeglotNextPluginOptions = PartialWeglotConfig;
6
+ declare function withWeglot(nextConfig: NextConfig | undefined, weglotOptions: WeglotNextPluginOptions): Promise<NextConfig>;
7
+ //#endregion
8
+ export { WeglotNextPluginOptions, withWeglot };
9
+ //# sourceMappingURL=next.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.cts","names":[],"sources":["../../src/plugin/next.ts"],"sourcesContent":[],"mappings":";;;;KAmBY,uBAAA,GAA0B;iBA0LhB,UAAA,aACR,uCACG,0BACd,QAAQ"}
@@ -0,0 +1,9 @@
1
+ import { PartialWeglotConfig } from "../types.mjs";
2
+ import { NextConfig } from "next";
3
+
4
+ //#region src/plugin/next.d.ts
5
+ type WeglotNextPluginOptions = PartialWeglotConfig;
6
+ declare function withWeglot(nextConfig: NextConfig | undefined, weglotOptions: WeglotNextPluginOptions): Promise<NextConfig>;
7
+ //#endregion
8
+ export { WeglotNextPluginOptions, withWeglot };
9
+ //# sourceMappingURL=next.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.mts","names":[],"sources":["../../src/plugin/next.ts"],"sourcesContent":[],"mappings":";;;;KAmBY,uBAAA,GAA0B;iBA0LhB,UAAA,aACR,uCACG,0BACd,QAAQ"}