@open-xchange/vite-plugin-ox-manifests 1.0.0-pre2 → 1.0.0-pre4
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/plugins/gettext.js
CHANGED
|
@@ -26,12 +26,12 @@ export default definePlugin(() => {
|
|
|
26
26
|
const po = await parsePoFile(file);
|
|
27
27
|
for (const namespace of namespacesFrom(po.items)) {
|
|
28
28
|
if (namespace !== defaultDictionary) {
|
|
29
|
-
input[namespace] = `gettext?dictionary=${namespace}`;
|
|
29
|
+
input[namespace] = `virtual:gettext?dictionary=${namespace}`;
|
|
30
30
|
manifests.push({ namespace: 'i18n', path: namespace });
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
|
-
input[defaultDictionary] = 'gettext';
|
|
34
|
+
input[defaultDictionary] = 'virtual:gettext';
|
|
35
35
|
manifests.push({ namespace: 'i18n', path: defaultDictionary });
|
|
36
36
|
// Track expected output file names for dictionary chunks so we can
|
|
37
37
|
// identify them in generateBundle (chunk.modules is empty in Rolldown)
|
|
@@ -49,14 +49,14 @@ export default definePlugin(() => {
|
|
|
49
49
|
return manifests.map(manifest => ({ ...manifest, raw: posix.join(resolvedConfig.base, `/@id/${manifest.path}.js`) }));
|
|
50
50
|
},
|
|
51
51
|
// In Rolldown, chunk.modules is empty and getModuleInfo().meta is not
|
|
52
|
-
// mutable. Identify dictionary chunks by matching their
|
|
52
|
+
// mutable. Identify dictionary chunks by matching their chunk name
|
|
53
53
|
// against the known dictionary namespaces, and annotate them directly.
|
|
54
54
|
generateBundle(_options, bundle) {
|
|
55
55
|
for (const file in bundle) {
|
|
56
56
|
const chunk = bundle[file];
|
|
57
57
|
if (chunk.type !== 'chunk')
|
|
58
58
|
continue;
|
|
59
|
-
if (dictionaryFileNames.has(
|
|
59
|
+
if (dictionaryFileNames.has(`${chunk.name}.js`)) {
|
|
60
60
|
const c = chunk;
|
|
61
61
|
const arr = (c._oxManifests ?? []);
|
|
62
62
|
arr.push({ namespace: 'i18n', path: '' });
|
|
@@ -29,6 +29,9 @@ async function getManifestEntryFile(basePath, extensions) {
|
|
|
29
29
|
function getChunkOriginalFileName(chunk, root) {
|
|
30
30
|
if (chunk.facadeModuleId) {
|
|
31
31
|
let name = chunk.facadeModuleId;
|
|
32
|
+
// strip virtual module prefix
|
|
33
|
+
if (name.startsWith('\0'))
|
|
34
|
+
name = name.slice(1);
|
|
32
35
|
// strip query params
|
|
33
36
|
const queryIndex = name.indexOf('?');
|
|
34
37
|
if (queryIndex >= 0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/vite-plugin-ox-manifests",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-pre4",
|
|
4
4
|
"description": "A vite plugin to concat and serve ox manifests",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"fast-glob": "^3.3.3",
|
|
27
27
|
"magic-string": "^0.30.21",
|
|
28
28
|
"parseurl": "^1.3.3",
|
|
29
|
-
"@open-xchange/vite-plugin-po2json": "1.0.0-
|
|
29
|
+
"@open-xchange/vite-plugin-po2json": "1.0.0-pre2",
|
|
30
30
|
"@open-xchange/vite-plugin-ox-externals": "1.0.0-pre1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|