mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
fix: build dist with locales (#4910)
This commit is contained in:
11
index-with-locales.js
Normal file
11
index-with-locales.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const antd = require('./components');
|
||||
const req = require.context('./components', true, /^\.\/locale-provider\/.+_.+\.tsx$/);
|
||||
|
||||
antd.locales = {};
|
||||
|
||||
req.keys().forEach((mod) => {
|
||||
const match = mod.match(/\/([^/]+).tsx$/);
|
||||
antd.locales[match[1]] = req(mod);
|
||||
});
|
||||
|
||||
module.exports = antd;
|
||||
Reference in New Issue
Block a user