mirror of https://github.com/ElemeFE/element
Build: fix build locales, make sure only read `js` files (#9879)
parent
6dbbee35e6
commit
061130e1c7
|
@ -15,21 +15,25 @@ var transform = function(filename, name, cb) {
|
|||
}, cb);
|
||||
};
|
||||
|
||||
fileList.forEach(function(file) {
|
||||
var name = basename(file, '.js');
|
||||
fileList
|
||||
.filter(function(file) {
|
||||
return /\.js$/.test(file);
|
||||
})
|
||||
.forEach(function(file) {
|
||||
var name = basename(file, '.js');
|
||||
|
||||
transform(file, name, function(err, result) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
var code = result.code;
|
||||
transform(file, name, function(err, result) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
var code = result.code;
|
||||
|
||||
code = code
|
||||
.replace('define(\'', 'define(\'element/locale/')
|
||||
.replace('global.', 'global.ELEMENT.lang = global.ELEMENT.lang || {}; \n global.ELEMENT.lang.');
|
||||
save(resolve(__dirname, '../../lib/umd/locale', file)).write(code);
|
||||
code = code
|
||||
.replace('define(\'', 'define(\'element/locale/')
|
||||
.replace('global.', 'global.ELEMENT.lang = global.ELEMENT.lang || {}; \n global.ELEMENT.lang.');
|
||||
save(resolve(__dirname, '../../lib/umd/locale', file)).write(code);
|
||||
|
||||
console.log(file);
|
||||
}
|
||||
console.log(file);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue