Matthias Hryniszak
11 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
0 deletions
-
packages/cli/src/build.ts
|
|
|
@ -52,10 +52,15 @@ export const buildLocale = async (opts: BuildOptions = {}) => { |
|
|
|
const babelOpts = { ...babelConfig(buildWebpackArgs(opts) as any) }; |
|
|
|
fs.readdirSync(localDst).forEach((file) => { |
|
|
|
const filePath = `${localDst}/${file}`; |
|
|
|
const esModuleFileName = filePath.replace(/\.[^.]+$/, '.mjs'); |
|
|
|
fs.copyFileSync(filePath, esModuleFileName); |
|
|
|
const compiled = transformFileSync(filePath, babelOpts).code; |
|
|
|
fs.writeFileSync(filePath, compiled); |
|
|
|
}); |
|
|
|
|
|
|
|
// Remove the index.mjs as it is useless
|
|
|
|
fs.unlinkSync(`${localDst}/index.mjs`); |
|
|
|
|
|
|
|
printRow('Locale files building completed successfully!'); |
|
|
|
}; |
|
|
|
|
|
|
|
|