Skip to content

Commit 63bf2a5

Browse files
committed
build(combobox-web): add rollup config for i18n locales
1 parent c13c432 commit 63bf2a5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const { join } = require("path");
2+
const { cp, mkdir } = require("shelljs");
3+
4+
const sourcePath = process.cwd();
5+
const outDir = join(sourcePath, "/dist/tmp/widgets/");
6+
const widgetPackageJson = require(join(sourcePath, "package.json"));
7+
const widgetName = widgetPackageJson.widgetName;
8+
const widgetPackage = widgetPackageJson.packagePath;
9+
const outWidgetDir = join(widgetPackage.replace(/\./g, "/"), widgetName.toLowerCase());
10+
const absoluteOutPackageDir = join(outDir, outWidgetDir);
11+
12+
module.exports = args => {
13+
const result = args.configDefaultConfig;
14+
15+
// Ensure the locales directory exists in the output
16+
const localesDir = join(absoluteOutPackageDir, "locales");
17+
mkdir("-p", localesDir);
18+
19+
// Copy translation files
20+
const translationFiles = join(sourcePath, "dist/locales/**/*");
21+
cp("-r", translationFiles, localesDir);
22+
23+
return result;
24+
};

0 commit comments

Comments
 (0)