nuxt-i18n-micro 1.36.1 → 1.37.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/dist/client/200.html +10 -10
- package/dist/client/404.html +10 -10
- package/dist/client/_nuxt/{Bg-EgkMt.js → CBccCxXK.js} +1 -1
- package/dist/client/_nuxt/{B-rdPz5C.js → DNen4El9.js} +1 -1
- package/dist/client/_nuxt/{BSIK_tlD.js → Ltm7XuUs.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d48170a8-5b86-44b8-8103-1aa6250c5f55.json +1 -0
- package/dist/client/_nuxt/n4MbYZHF.js +3822 -0
- package/dist/client/index.html +10 -10
- package/dist/module.json +1 -1
- package/dist/module.mjs +30 -9
- package/package.json +1 -1
- package/dist/client/_nuxt/Bi0F1qle.js +0 -3822
- package/dist/client/_nuxt/builds/meta/c0d0f579-bc8e-401c-b344-5ab0f1c7c077.json +0 -1
package/dist/client/index.html
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/
|
|
4
|
-
<link rel="modulepreload" as="script" crossorigin href="/
|
|
5
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
6
|
-
<link rel="prefetch" as="style" crossorigin href="/
|
|
7
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
9
|
-
<link rel="prefetch" as="style" crossorigin href="/
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
11
|
-
<script type="module" src="/
|
|
12
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/entry.BWujgj23.css" crossorigin>
|
|
4
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/n4MbYZHF.js">
|
|
5
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/B6E6ObS_.js">
|
|
6
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-404.SWzu_puR.css">
|
|
7
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/Ltm7XuUs.js">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CBccCxXK.js">
|
|
9
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.Bkv_zTjr.css">
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DNen4El9.js">
|
|
11
|
+
<script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/n4MbYZHF.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1733208468833,false]</script>
|
|
12
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"d48170a8-5b86-44b8-8103-1aa6250c5f55",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
1
|
+
import path, { resolve } from 'node:path';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import fs__default, { readFileSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { useNuxt, defineNuxtModule, useLogger, createResolver, addTemplate, addPlugin, addImportsDir, addServerHandler, addComponentsDir, addTypeTemplate, extendPages, addPrerenderRoutes } from '@nuxt/kit';
|
|
5
5
|
import { watch } from 'chokidar';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
8
|
+
import sirv from 'sirv';
|
|
7
9
|
|
|
8
10
|
const DEVTOOLS_UI_PORT = 3030;
|
|
9
11
|
const DEVTOOLS_UI_ROUTE = "/__nuxt-i18n-micro";
|
|
10
|
-
|
|
12
|
+
const distDir = resolve(fileURLToPath(import.meta.url), "..");
|
|
13
|
+
const clientDir = resolve(distDir, "client");
|
|
14
|
+
function setupDevToolsUI(options, resolve2) {
|
|
11
15
|
const nuxt = useNuxt();
|
|
12
|
-
const clientPath =
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const clientPath = resolve2("./client");
|
|
17
|
+
const clientDirExists = fs.existsSync(clientPath);
|
|
18
|
+
const ROUTE_PATH = `${nuxt.options.app.baseURL || "/"}/__nuxt-i18n-micro`.replace(/\/+/g, "/");
|
|
19
|
+
const ROUTE_CLIENT = `${ROUTE_PATH}/client`;
|
|
20
|
+
if (clientDirExists) {
|
|
21
|
+
nuxt.hook("vite:serverCreated", (server) => {
|
|
22
|
+
const indexHtmlPath = path.join(clientDir, "index.html");
|
|
23
|
+
const indexContent = fs.readFileSync(indexHtmlPath);
|
|
24
|
+
const handleStatic = sirv(clientDir, {
|
|
25
|
+
dev: true,
|
|
26
|
+
single: false
|
|
27
|
+
});
|
|
28
|
+
const handleIndex = async (res) => {
|
|
29
|
+
res.setHeader("Content-Type", "text/html");
|
|
30
|
+
res.statusCode = 200;
|
|
31
|
+
res.write((await indexContent).toString().replace(/\/__NUXT_DEVTOOLS_I18N_BASE__\//g, `${ROUTE_CLIENT}/`));
|
|
32
|
+
res.end();
|
|
33
|
+
};
|
|
34
|
+
server.middlewares.use(ROUTE_CLIENT, (req, res) => {
|
|
35
|
+
if (req.url === "/")
|
|
36
|
+
return handleIndex(res);
|
|
37
|
+
return handleStatic(req, res, () => handleIndex(res));
|
|
38
|
+
});
|
|
18
39
|
});
|
|
19
40
|
} else {
|
|
20
41
|
nuxt.hook("vite:extendConfig", (config) => {
|
|
@@ -81,7 +102,7 @@ function setupDevToolsUI(options, resolve) {
|
|
|
81
102
|
icon: "carbon:language",
|
|
82
103
|
view: {
|
|
83
104
|
type: "iframe",
|
|
84
|
-
src:
|
|
105
|
+
src: ROUTE_CLIENT
|
|
85
106
|
}
|
|
86
107
|
});
|
|
87
108
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-i18n-micro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "Nuxt I18n Micro is a lightweight, high-performance internationalization module for Nuxt, designed to handle multi-language support with minimal overhead, fast build times, and efficient runtime performance.",
|
|
5
5
|
"repository": "s00d/nuxt-i18n-micro",
|
|
6
6
|
"license": "MIT",
|