We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26136c0 commit 1ae4040Copy full SHA for 1ae4040
packages/cli/src/build.ts
@@ -52,10 +52,15 @@ export const buildLocale = async (opts: BuildOptions = {}) => {
52
const babelOpts = { ...babelConfig(buildWebpackArgs(opts) as any) };
53
fs.readdirSync(localDst).forEach((file) => {
54
const filePath = `${localDst}/${file}`;
55
+ const esModuleFileName = filePath.replace(/\.[^.]+$/, '.mjs');
56
+ fs.copyFileSync(filePath, esModuleFileName);
57
const compiled = transformFileSync(filePath, babelOpts).code;
58
fs.writeFileSync(filePath, compiled);
59
});
60
61
+ // Remove the index.mjs as it is useless
62
+ fs.unlinkSync(`${localDst}/index.mjs`);
63
+
64
printRow('Locale files building completed successfully!');
65
};
66
0 commit comments