fix: build dist with locales (#4910)

This commit is contained in:
Wei Zhu
2017-02-17 09:36:42 +08:00
committed by Benjy Cui
parent df3617dded
commit 58afe5f729
2 changed files with 21 additions and 0 deletions

11
index-with-locales.js Normal file
View 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;