vite-intlayer 7.3.6 → 7.3.8
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/cjs/intlayerPrunePlugin.cjs +20 -8
- package/dist/cjs/intlayerPrunePlugin.cjs.map +1 -1
- package/dist/esm/intlayerPrunePlugin.mjs +20 -8
- package/dist/esm/intlayerPrunePlugin.mjs.map +1 -1
- package/dist/types/intlayerPrunePlugin.d.ts +1 -1
- package/dist/types/intlayerPrunePlugin.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -15,10 +15,7 @@ const intlayerPrune = (intlayerConfig) => {
|
|
|
15
15
|
const logger = (0, __intlayer_config.getAppLogger)(intlayerConfig);
|
|
16
16
|
const { importMode, traversePattern, optimize } = intlayerConfig.build;
|
|
17
17
|
const { dictionariesDir, dynamicDictionariesDir, unmergedDictionariesDir, fetchDictionariesDir, mainDir, baseDir } = intlayerConfig.content;
|
|
18
|
-
const filesListPattern = fast_glob.default.sync(traversePattern, {
|
|
19
|
-
cwd: baseDir,
|
|
20
|
-
ignore: ["*.map"]
|
|
21
|
-
}).map((file) => {
|
|
18
|
+
const filesListPattern = fast_glob.default.sync(traversePattern, { cwd: baseDir }).map((file) => {
|
|
22
19
|
if ((0, node_path.isAbsolute)(file)) return file;
|
|
23
20
|
return (0, node_path.join)(baseDir, file);
|
|
24
21
|
});
|
|
@@ -32,12 +29,27 @@ const intlayerPrune = (intlayerConfig) => {
|
|
|
32
29
|
];
|
|
33
30
|
const dictionaries = (0, __intlayer_dictionaries_entry.getDictionaries)(intlayerConfig);
|
|
34
31
|
const liveSyncKeys = Object.values(dictionaries).filter((dictionary) => dictionary.live).map((dictionary) => dictionary.key);
|
|
35
|
-
return {
|
|
32
|
+
return [{
|
|
33
|
+
name: "vite-intlayer-simple-transform",
|
|
34
|
+
enforce: "pre",
|
|
35
|
+
apply: (_config, env) => {
|
|
36
|
+
const isBuild = env.command === "build";
|
|
37
|
+
return (optimize === void 0 && isBuild || optimize === true) && (importMode === "dynamic" || importMode === "live");
|
|
38
|
+
},
|
|
39
|
+
transform(code, id) {
|
|
40
|
+
if (!id.endsWith(".vue")) return null;
|
|
41
|
+
if (!code.includes("useIntlayer")) return null;
|
|
42
|
+
return {
|
|
43
|
+
code: code.replace(/(\s+|=\s*)useIntlayer\s*\(/g, "$1await useIntlayer("),
|
|
44
|
+
map: null
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
36
48
|
name: "vite-intlayer-babel-transform",
|
|
37
49
|
enforce: "post",
|
|
38
50
|
apply: (_config, env) => {
|
|
39
51
|
const isBuild = env.command === "build";
|
|
40
|
-
const isEnabled =
|
|
52
|
+
const isEnabled = optimize === void 0 && isBuild || optimize === true;
|
|
41
53
|
if (isEnabled) (0, __intlayer_chokidar.runOnce)((0, node_path.join)(baseDir, ".intlayer", "cache", "intlayer-prune-plugin-enabled.lock"), () => logger("Build optimization enabled"), { cacheTimeoutMs: 1e3 * 10 });
|
|
42
54
|
return isEnabled;
|
|
43
55
|
},
|
|
@@ -92,10 +104,10 @@ const intlayerPrune = (intlayerConfig) => {
|
|
|
92
104
|
map: result.map
|
|
93
105
|
};
|
|
94
106
|
}
|
|
95
|
-
};
|
|
107
|
+
}];
|
|
96
108
|
} catch (error) {
|
|
97
109
|
console.warn("Failed to transform with Babel plugin:", error);
|
|
98
|
-
return
|
|
110
|
+
return [];
|
|
99
111
|
}
|
|
100
112
|
};
|
|
101
113
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerPrunePlugin.cjs","names":["fg","intlayerOptimizeBabelPlugin"],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { isAbsolute, join } from 'node:path';\nimport { intlayerOptimizeBabelPlugin } from '@intlayer/babel';\nimport { runOnce } from '@intlayer/chokidar';\nimport { getAppLogger } from '@intlayer/config';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport type { PluginOption } from 'vite';\n\nexport const intlayerPrune = (intlayerConfig: IntlayerConfig): PluginOption => {\n try {\n const localeRequire = createRequire(import.meta.url);\n const babel = localeRequire('@babel/core');\n const logger = getAppLogger(intlayerConfig);\n\n const { importMode, traversePattern, optimize } = intlayerConfig.build;\n\n const {\n dictionariesDir,\n dynamicDictionariesDir,\n unmergedDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n baseDir,\n } = intlayerConfig.content;\n\n const filesListPattern = fg\n .sync(traversePattern, {\n cwd: baseDir,\n
|
|
1
|
+
{"version":3,"file":"intlayerPrunePlugin.cjs","names":["fg","intlayerOptimizeBabelPlugin"],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { isAbsolute, join } from 'node:path';\nimport { intlayerOptimizeBabelPlugin } from '@intlayer/babel';\nimport { runOnce } from '@intlayer/chokidar';\nimport { getAppLogger } from '@intlayer/config';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport type { PluginOption } from 'vite';\n\nexport const intlayerPrune = (\n intlayerConfig: IntlayerConfig\n): PluginOption[] => {\n try {\n const localeRequire = createRequire(import.meta.url);\n const babel = localeRequire('@babel/core');\n const logger = getAppLogger(intlayerConfig);\n\n const { importMode, traversePattern, optimize } = intlayerConfig.build;\n\n const {\n dictionariesDir,\n dynamicDictionariesDir,\n unmergedDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n baseDir,\n } = intlayerConfig.content;\n\n const filesListPattern = fg\n .sync(traversePattern, {\n cwd: baseDir,\n })\n .map((file) => {\n if (isAbsolute(file)) {\n return file;\n }\n return join(baseDir, file);\n });\n\n const dictionariesEntryPath = join(mainDir, 'dictionaries.mjs');\n const unmergedDictionariesEntryPath = join(\n mainDir,\n 'unmerged_dictionaries.mjs'\n );\n const dynamicDictionariesEntryPath = join(\n mainDir,\n 'dynamic_dictionaries.mjs'\n );\n\n const filesList = [\n ...filesListPattern,\n dictionariesEntryPath, // should add dictionariesEntryPath to replace it by a empty object if import made dynamic\n unmergedDictionariesEntryPath, // should add dictionariesEntryPath to replace it by a empty object if import made dynamic\n ];\n\n const dictionaries = getDictionaries(intlayerConfig);\n const liveSyncKeys = Object.values(dictionaries)\n .filter((dictionary) => dictionary.live)\n .map((dictionary) => dictionary.key);\n\n return [\n {\n /**\n * On vue, we pre-insert the 'await' to the useIntlayer call\n * It will trigger the transformation of the async call by the vue compiler\n *\n * Then the second plugin will make the second transformation to replace the useIntlayer call by the useDictionaryDynamic call\n */\n name: 'vite-intlayer-simple-transform',\n enforce: 'pre', // Run before Vue so Vue sees the 'await'\n apply: (_config, env) => {\n // Only apply babel plugin if optimize is enabled\n\n const isBuild = env.command === 'build';\n const isEnabled =\n (optimize === undefined && isBuild) || optimize === true;\n const isAsync = importMode === 'dynamic' || importMode === 'live';\n\n return isEnabled && isAsync;\n },\n\n transform(code, id) {\n // 1. Only process .vue files\n // The await injection is only needed for Vue to trigger async component compilation\n if (!id.endsWith('.vue')) return null;\n\n // 2. Check if the file actually uses the composable to avoid unnecessary work\n if (!code.includes('useIntlayer')) return null;\n\n // B. Add 'await' to the function call\n // Matches: useIntlayer(args) -> await useIntlayer(args)\n // Note: Since we aliased the import above, 'useIntlayer' now refers to 'useDictionaryAsync'\n const transformedCode = code.replace(\n /(\\s+|=\\s*)useIntlayer\\s*\\(/g,\n '$1await useIntlayer('\n );\n\n return {\n code: transformedCode,\n map: null, // Simple string replace doesn't strictly need a sourcemap for this case\n };\n },\n },\n {\n name: 'vite-intlayer-babel-transform',\n enforce: 'post', // Run after other transformations as vue\n apply: (_config, env) => {\n // Only apply babel plugin if optimize is enabled\n\n const isBuild = env.command === 'build';\n const isEnabled =\n (optimize === undefined && isBuild) || optimize === true;\n\n if (isEnabled) {\n runOnce(\n join(\n baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-prune-plugin-enabled.lock'\n ),\n () => logger('Build optimization enabled'),\n {\n cacheTimeoutMs: 1000 * 10, // 10 seconds\n }\n );\n }\n\n return isEnabled;\n },\n transform(code, id) {\n /**\n * Transform file as\n * .../HelloWorld.vue?vue&type=script&setup=true&lang.ts\n * Into\n * .../HelloWorld.vue\n *\n * Prevention for virtual file\n */\n const filename = id.split('?', 1)[0];\n\n if (!filesList.includes(filename)) return null;\n\n const result = babel.transformSync(code, {\n filename,\n plugins: [\n [\n intlayerOptimizeBabelPlugin,\n {\n optimize,\n dictionariesDir,\n dictionariesEntryPath,\n unmergedDictionariesEntryPath,\n unmergedDictionariesDir,\n dynamicDictionariesDir,\n dynamicDictionariesEntryPath,\n fetchDictionariesDir,\n importMode,\n filesList,\n replaceDictionaryEntry: true,\n liveSyncKeys,\n },\n ],\n ],\n parserOpts: {\n sourceType: 'module',\n allowImportExportEverywhere: true,\n plugins: [\n 'typescript',\n 'jsx',\n 'decorators-legacy',\n 'classProperties',\n 'objectRestSpread',\n 'asyncGenerators',\n 'functionBind',\n 'exportDefaultFrom',\n 'exportNamespaceFrom',\n 'dynamicImport',\n 'nullishCoalescingOperator',\n 'optionalChaining',\n ],\n },\n });\n\n if (result?.code) {\n return {\n code: result.code,\n map: result.map,\n };\n }\n },\n },\n ];\n } catch (error) {\n console.warn('Failed to transform with Babel plugin:', error);\n\n return [];\n }\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,iBACX,mBACmB;AACnB,KAAI;EAEF,MAAM,qFAD8C,CACxB,cAAc;EAC1C,MAAM,6CAAsB,eAAe;EAE3C,MAAM,EAAE,YAAY,iBAAiB,aAAa,eAAe;EAEjE,MAAM,EACJ,iBACA,wBACA,yBACA,sBACA,SACA,YACE,eAAe;EAEnB,MAAM,mBAAmBA,kBACtB,KAAK,iBAAiB,EACrB,KAAK,SACN,CAAC,CACD,KAAK,SAAS;AACb,iCAAe,KAAK,CAClB,QAAO;AAET,8BAAY,SAAS,KAAK;IAC1B;EAEJ,MAAM,4CAA6B,SAAS,mBAAmB;EAC/D,MAAM,oDACJ,SACA,4BACD;EACD,MAAM,mDACJ,SACA,2BACD;EAED,MAAM,YAAY;GAChB,GAAG;GACH;GACA;GACD;EAED,MAAM,kEAA+B,eAAe;EACpD,MAAM,eAAe,OAAO,OAAO,aAAa,CAC7C,QAAQ,eAAe,WAAW,KAAK,CACvC,KAAK,eAAe,WAAW,IAAI;AAEtC,SAAO,CACL;GAOE,MAAM;GACN,SAAS;GACT,QAAQ,SAAS,QAAQ;IAGvB,MAAM,UAAU,IAAI,YAAY;AAKhC,YAHG,aAAa,UAAa,WAAY,aAAa,UACtC,eAAe,aAAa,eAAe;;GAK7D,UAAU,MAAM,IAAI;AAGlB,QAAI,CAAC,GAAG,SAAS,OAAO,CAAE,QAAO;AAGjC,QAAI,CAAC,KAAK,SAAS,cAAc,CAAE,QAAO;AAU1C,WAAO;KACL,MANsB,KAAK,QAC3B,+BACA,uBACD;KAIC,KAAK;KACN;;GAEJ,EACD;GACE,MAAM;GACN,SAAS;GACT,QAAQ,SAAS,QAAQ;IAGvB,MAAM,UAAU,IAAI,YAAY;IAChC,MAAM,YACH,aAAa,UAAa,WAAY,aAAa;AAEtD,QAAI,UACF,sDAEI,SACA,aACA,SACA,qCACD,QACK,OAAO,6BAA6B,EAC1C,EACE,gBAAgB,MAAO,IACxB,CACF;AAGH,WAAO;;GAET,UAAU,MAAM,IAAI;;;;;;;;;IASlB,MAAM,WAAW,GAAG,MAAM,KAAK,EAAE,CAAC;AAElC,QAAI,CAAC,UAAU,SAAS,SAAS,CAAE,QAAO;IAE1C,MAAM,SAAS,MAAM,cAAc,MAAM;KACvC;KACA,SAAS,CACP,CACEC,8CACA;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,wBAAwB;MACxB;MACD,CACF,CACF;KACD,YAAY;MACV,YAAY;MACZ,6BAA6B;MAC7B,SAAS;OACP;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACD;MACF;KACF,CAAC;AAEF,QAAI,QAAQ,KACV,QAAO;KACL,MAAM,OAAO;KACb,KAAK,OAAO;KACb;;GAGN,CACF;UACM,OAAO;AACd,UAAQ,KAAK,0CAA0C,MAAM;AAE7D,SAAO,EAAE"}
|
|
@@ -13,10 +13,7 @@ const intlayerPrune = (intlayerConfig) => {
|
|
|
13
13
|
const logger = getAppLogger(intlayerConfig);
|
|
14
14
|
const { importMode, traversePattern, optimize } = intlayerConfig.build;
|
|
15
15
|
const { dictionariesDir, dynamicDictionariesDir, unmergedDictionariesDir, fetchDictionariesDir, mainDir, baseDir } = intlayerConfig.content;
|
|
16
|
-
const filesListPattern = fg.sync(traversePattern, {
|
|
17
|
-
cwd: baseDir,
|
|
18
|
-
ignore: ["*.map"]
|
|
19
|
-
}).map((file) => {
|
|
16
|
+
const filesListPattern = fg.sync(traversePattern, { cwd: baseDir }).map((file) => {
|
|
20
17
|
if (isAbsolute(file)) return file;
|
|
21
18
|
return join(baseDir, file);
|
|
22
19
|
});
|
|
@@ -30,12 +27,27 @@ const intlayerPrune = (intlayerConfig) => {
|
|
|
30
27
|
];
|
|
31
28
|
const dictionaries = getDictionaries(intlayerConfig);
|
|
32
29
|
const liveSyncKeys = Object.values(dictionaries).filter((dictionary) => dictionary.live).map((dictionary) => dictionary.key);
|
|
33
|
-
return {
|
|
30
|
+
return [{
|
|
31
|
+
name: "vite-intlayer-simple-transform",
|
|
32
|
+
enforce: "pre",
|
|
33
|
+
apply: (_config, env) => {
|
|
34
|
+
const isBuild = env.command === "build";
|
|
35
|
+
return (optimize === void 0 && isBuild || optimize === true) && (importMode === "dynamic" || importMode === "live");
|
|
36
|
+
},
|
|
37
|
+
transform(code, id) {
|
|
38
|
+
if (!id.endsWith(".vue")) return null;
|
|
39
|
+
if (!code.includes("useIntlayer")) return null;
|
|
40
|
+
return {
|
|
41
|
+
code: code.replace(/(\s+|=\s*)useIntlayer\s*\(/g, "$1await useIntlayer("),
|
|
42
|
+
map: null
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
34
46
|
name: "vite-intlayer-babel-transform",
|
|
35
47
|
enforce: "post",
|
|
36
48
|
apply: (_config, env) => {
|
|
37
49
|
const isBuild = env.command === "build";
|
|
38
|
-
const isEnabled =
|
|
50
|
+
const isEnabled = optimize === void 0 && isBuild || optimize === true;
|
|
39
51
|
if (isEnabled) runOnce(join(baseDir, ".intlayer", "cache", "intlayer-prune-plugin-enabled.lock"), () => logger("Build optimization enabled"), { cacheTimeoutMs: 1e3 * 10 });
|
|
40
52
|
return isEnabled;
|
|
41
53
|
},
|
|
@@ -90,10 +102,10 @@ const intlayerPrune = (intlayerConfig) => {
|
|
|
90
102
|
map: result.map
|
|
91
103
|
};
|
|
92
104
|
}
|
|
93
|
-
};
|
|
105
|
+
}];
|
|
94
106
|
} catch (error) {
|
|
95
107
|
console.warn("Failed to transform with Babel plugin:", error);
|
|
96
|
-
return
|
|
108
|
+
return [];
|
|
97
109
|
}
|
|
98
110
|
};
|
|
99
111
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerPrunePlugin.mjs","names":[],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { isAbsolute, join } from 'node:path';\nimport { intlayerOptimizeBabelPlugin } from '@intlayer/babel';\nimport { runOnce } from '@intlayer/chokidar';\nimport { getAppLogger } from '@intlayer/config';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport type { PluginOption } from 'vite';\n\nexport const intlayerPrune = (intlayerConfig: IntlayerConfig): PluginOption => {\n try {\n const localeRequire = createRequire(import.meta.url);\n const babel = localeRequire('@babel/core');\n const logger = getAppLogger(intlayerConfig);\n\n const { importMode, traversePattern, optimize } = intlayerConfig.build;\n\n const {\n dictionariesDir,\n dynamicDictionariesDir,\n unmergedDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n baseDir,\n } = intlayerConfig.content;\n\n const filesListPattern = fg\n .sync(traversePattern, {\n cwd: baseDir,\n
|
|
1
|
+
{"version":3,"file":"intlayerPrunePlugin.mjs","names":[],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { isAbsolute, join } from 'node:path';\nimport { intlayerOptimizeBabelPlugin } from '@intlayer/babel';\nimport { runOnce } from '@intlayer/chokidar';\nimport { getAppLogger } from '@intlayer/config';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport type { PluginOption } from 'vite';\n\nexport const intlayerPrune = (\n intlayerConfig: IntlayerConfig\n): PluginOption[] => {\n try {\n const localeRequire = createRequire(import.meta.url);\n const babel = localeRequire('@babel/core');\n const logger = getAppLogger(intlayerConfig);\n\n const { importMode, traversePattern, optimize } = intlayerConfig.build;\n\n const {\n dictionariesDir,\n dynamicDictionariesDir,\n unmergedDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n baseDir,\n } = intlayerConfig.content;\n\n const filesListPattern = fg\n .sync(traversePattern, {\n cwd: baseDir,\n })\n .map((file) => {\n if (isAbsolute(file)) {\n return file;\n }\n return join(baseDir, file);\n });\n\n const dictionariesEntryPath = join(mainDir, 'dictionaries.mjs');\n const unmergedDictionariesEntryPath = join(\n mainDir,\n 'unmerged_dictionaries.mjs'\n );\n const dynamicDictionariesEntryPath = join(\n mainDir,\n 'dynamic_dictionaries.mjs'\n );\n\n const filesList = [\n ...filesListPattern,\n dictionariesEntryPath, // should add dictionariesEntryPath to replace it by a empty object if import made dynamic\n unmergedDictionariesEntryPath, // should add dictionariesEntryPath to replace it by a empty object if import made dynamic\n ];\n\n const dictionaries = getDictionaries(intlayerConfig);\n const liveSyncKeys = Object.values(dictionaries)\n .filter((dictionary) => dictionary.live)\n .map((dictionary) => dictionary.key);\n\n return [\n {\n /**\n * On vue, we pre-insert the 'await' to the useIntlayer call\n * It will trigger the transformation of the async call by the vue compiler\n *\n * Then the second plugin will make the second transformation to replace the useIntlayer call by the useDictionaryDynamic call\n */\n name: 'vite-intlayer-simple-transform',\n enforce: 'pre', // Run before Vue so Vue sees the 'await'\n apply: (_config, env) => {\n // Only apply babel plugin if optimize is enabled\n\n const isBuild = env.command === 'build';\n const isEnabled =\n (optimize === undefined && isBuild) || optimize === true;\n const isAsync = importMode === 'dynamic' || importMode === 'live';\n\n return isEnabled && isAsync;\n },\n\n transform(code, id) {\n // 1. Only process .vue files\n // The await injection is only needed for Vue to trigger async component compilation\n if (!id.endsWith('.vue')) return null;\n\n // 2. Check if the file actually uses the composable to avoid unnecessary work\n if (!code.includes('useIntlayer')) return null;\n\n // B. Add 'await' to the function call\n // Matches: useIntlayer(args) -> await useIntlayer(args)\n // Note: Since we aliased the import above, 'useIntlayer' now refers to 'useDictionaryAsync'\n const transformedCode = code.replace(\n /(\\s+|=\\s*)useIntlayer\\s*\\(/g,\n '$1await useIntlayer('\n );\n\n return {\n code: transformedCode,\n map: null, // Simple string replace doesn't strictly need a sourcemap for this case\n };\n },\n },\n {\n name: 'vite-intlayer-babel-transform',\n enforce: 'post', // Run after other transformations as vue\n apply: (_config, env) => {\n // Only apply babel plugin if optimize is enabled\n\n const isBuild = env.command === 'build';\n const isEnabled =\n (optimize === undefined && isBuild) || optimize === true;\n\n if (isEnabled) {\n runOnce(\n join(\n baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-prune-plugin-enabled.lock'\n ),\n () => logger('Build optimization enabled'),\n {\n cacheTimeoutMs: 1000 * 10, // 10 seconds\n }\n );\n }\n\n return isEnabled;\n },\n transform(code, id) {\n /**\n * Transform file as\n * .../HelloWorld.vue?vue&type=script&setup=true&lang.ts\n * Into\n * .../HelloWorld.vue\n *\n * Prevention for virtual file\n */\n const filename = id.split('?', 1)[0];\n\n if (!filesList.includes(filename)) return null;\n\n const result = babel.transformSync(code, {\n filename,\n plugins: [\n [\n intlayerOptimizeBabelPlugin,\n {\n optimize,\n dictionariesDir,\n dictionariesEntryPath,\n unmergedDictionariesEntryPath,\n unmergedDictionariesDir,\n dynamicDictionariesDir,\n dynamicDictionariesEntryPath,\n fetchDictionariesDir,\n importMode,\n filesList,\n replaceDictionaryEntry: true,\n liveSyncKeys,\n },\n ],\n ],\n parserOpts: {\n sourceType: 'module',\n allowImportExportEverywhere: true,\n plugins: [\n 'typescript',\n 'jsx',\n 'decorators-legacy',\n 'classProperties',\n 'objectRestSpread',\n 'asyncGenerators',\n 'functionBind',\n 'exportDefaultFrom',\n 'exportNamespaceFrom',\n 'dynamicImport',\n 'nullishCoalescingOperator',\n 'optionalChaining',\n ],\n },\n });\n\n if (result?.code) {\n return {\n code: result.code,\n map: result.map,\n };\n }\n },\n },\n ];\n } catch (error) {\n console.warn('Failed to transform with Babel plugin:', error);\n\n return [];\n }\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,iBACX,mBACmB;AACnB,KAAI;EAEF,MAAM,QADgB,cAAc,OAAO,KAAK,IAAI,CACxB,cAAc;EAC1C,MAAM,SAAS,aAAa,eAAe;EAE3C,MAAM,EAAE,YAAY,iBAAiB,aAAa,eAAe;EAEjE,MAAM,EACJ,iBACA,wBACA,yBACA,sBACA,SACA,YACE,eAAe;EAEnB,MAAM,mBAAmB,GACtB,KAAK,iBAAiB,EACrB,KAAK,SACN,CAAC,CACD,KAAK,SAAS;AACb,OAAI,WAAW,KAAK,CAClB,QAAO;AAET,UAAO,KAAK,SAAS,KAAK;IAC1B;EAEJ,MAAM,wBAAwB,KAAK,SAAS,mBAAmB;EAC/D,MAAM,gCAAgC,KACpC,SACA,4BACD;EACD,MAAM,+BAA+B,KACnC,SACA,2BACD;EAED,MAAM,YAAY;GAChB,GAAG;GACH;GACA;GACD;EAED,MAAM,eAAe,gBAAgB,eAAe;EACpD,MAAM,eAAe,OAAO,OAAO,aAAa,CAC7C,QAAQ,eAAe,WAAW,KAAK,CACvC,KAAK,eAAe,WAAW,IAAI;AAEtC,SAAO,CACL;GAOE,MAAM;GACN,SAAS;GACT,QAAQ,SAAS,QAAQ;IAGvB,MAAM,UAAU,IAAI,YAAY;AAKhC,YAHG,aAAa,UAAa,WAAY,aAAa,UACtC,eAAe,aAAa,eAAe;;GAK7D,UAAU,MAAM,IAAI;AAGlB,QAAI,CAAC,GAAG,SAAS,OAAO,CAAE,QAAO;AAGjC,QAAI,CAAC,KAAK,SAAS,cAAc,CAAE,QAAO;AAU1C,WAAO;KACL,MANsB,KAAK,QAC3B,+BACA,uBACD;KAIC,KAAK;KACN;;GAEJ,EACD;GACE,MAAM;GACN,SAAS;GACT,QAAQ,SAAS,QAAQ;IAGvB,MAAM,UAAU,IAAI,YAAY;IAChC,MAAM,YACH,aAAa,UAAa,WAAY,aAAa;AAEtD,QAAI,UACF,SACE,KACE,SACA,aACA,SACA,qCACD,QACK,OAAO,6BAA6B,EAC1C,EACE,gBAAgB,MAAO,IACxB,CACF;AAGH,WAAO;;GAET,UAAU,MAAM,IAAI;;;;;;;;;IASlB,MAAM,WAAW,GAAG,MAAM,KAAK,EAAE,CAAC;AAElC,QAAI,CAAC,UAAU,SAAS,SAAS,CAAE,QAAO;IAE1C,MAAM,SAAS,MAAM,cAAc,MAAM;KACvC;KACA,SAAS,CACP,CACE,6BACA;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,wBAAwB;MACxB;MACD,CACF,CACF;KACD,YAAY;MACV,YAAY;MACZ,6BAA6B;MAC7B,SAAS;OACP;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACD;MACF;KACF,CAAC;AAEF,QAAI,QAAQ,KACV,QAAO;KACL,MAAM,OAAO;KACb,KAAK,OAAO;KACb;;GAGN,CACF;UACM,OAAO;AACd,UAAQ,KAAK,0CAA0C,MAAM;AAE7D,SAAO,EAAE"}
|
|
@@ -2,7 +2,7 @@ import { IntlayerConfig } from "@intlayer/types";
|
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/intlayerPrunePlugin.d.ts
|
|
5
|
-
declare const intlayerPrune: (intlayerConfig: IntlayerConfig) => PluginOption;
|
|
5
|
+
declare const intlayerPrune: (intlayerConfig: IntlayerConfig) => PluginOption[];
|
|
6
6
|
//#endregion
|
|
7
7
|
export { intlayerPrune };
|
|
8
8
|
//# sourceMappingURL=intlayerPrunePlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerPrunePlugin.d.ts","names":[],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":[],"mappings":";;;;cAUa,
|
|
1
|
+
{"version":3,"file":"intlayerPrunePlugin.d.ts","names":[],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":[],"mappings":";;;;cAUa,gCACK,mBACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-intlayer",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Vite plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration",
|
|
6
6
|
"keywords": [
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@babel/core": "7.28.4",
|
|
80
|
-
"@intlayer/babel": "7.3.
|
|
81
|
-
"@intlayer/chokidar": "7.3.
|
|
82
|
-
"@intlayer/config": "7.3.
|
|
83
|
-
"@intlayer/core": "7.3.
|
|
84
|
-
"@intlayer/dictionaries-entry": "7.3.
|
|
85
|
-
"@intlayer/types": "7.3.
|
|
80
|
+
"@intlayer/babel": "7.3.8",
|
|
81
|
+
"@intlayer/chokidar": "7.3.8",
|
|
82
|
+
"@intlayer/config": "7.3.8",
|
|
83
|
+
"@intlayer/core": "7.3.8",
|
|
84
|
+
"@intlayer/dictionaries-entry": "7.3.8",
|
|
85
|
+
"@intlayer/types": "7.3.8",
|
|
86
86
|
"fast-glob": "3.3.3",
|
|
87
|
-
"intlayer": "7.3.
|
|
87
|
+
"intlayer": "7.3.8"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/node": "24.10.1",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@babel/core": ">=6.0.0",
|
|
101
|
-
"@intlayer/svelte-compiler": "7.3.
|
|
102
|
-
"@intlayer/vue-compiler": "7.3.
|
|
101
|
+
"@intlayer/svelte-compiler": "7.3.8",
|
|
102
|
+
"@intlayer/vue-compiler": "7.3.8",
|
|
103
103
|
"vite": ">=4.0.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependenciesMeta": {
|