feat(common): generate closure-locale.ts
to tree shake locale data (#18907)
Closure will only keep the data for the locale defined in `goog.LOCALE` PR Close #18907
This commit is contained in:

committed by
Miško Hevery

parent
4c5aac8cd5
commit
48789360b1
@ -25,5 +25,16 @@ module.exports = {
|
||||
fs.mkdirSync(cldrDataFolder);
|
||||
}
|
||||
cldrDownloader(path.join(__dirname, 'cldr/cldr-urls.json'), cldrDataFolder, done);
|
||||
}
|
||||
},
|
||||
|
||||
closure: gulp => done => {
|
||||
const {RELATIVE_I18N_DATA_FOLDER} = require('./cldr/extract');
|
||||
console.log(RELATIVE_I18N_DATA_FOLDER, fs.existsSync(RELATIVE_I18N_DATA_FOLDER));
|
||||
if (!fs.existsSync(RELATIVE_I18N_DATA_FOLDER)) {
|
||||
throw new Error(
|
||||
`You must run "gulp cldr:extract" before you can create the closure-locale.ts file`);
|
||||
}
|
||||
const localeAll = require('./cldr/closure');
|
||||
return localeAll(gulp, done);
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user