Differences in synchronization codes between blue and yellow areas

Signed-off-by: lixinnan <lixinnan1@huawei.com>
Change-Id: Id182fcf273124aea23f16ed2d6b745d36f5bc3ac
This commit is contained in:
lixinnan 2024-07-22 10:54:18 +08:00
parent 34e6bd5fbd
commit fcee5cd05a
2 changed files with 15 additions and 15 deletions

View File

@ -31,7 +31,7 @@ module.exports = function(api) {
'@babel/plugin-transform-arrow-functions', '@babel/plugin-transform-arrow-functions',
{spec: true}, {spec: true},
] ]
] ];
plugins.push(...liteArray); plugins.push(...liteArray);
} }
return { return {
@ -40,4 +40,3 @@ module.exports = function(api) {
comments: false comments: false
}; };
}; };

View File

@ -13,32 +13,33 @@
* limitations under the License. * limitations under the License.
*/ */
const fs = require('fs') const fs = require('fs');
const path = require('path') const path = require('path');
const uglifyJS = require('uglify-js') const uglifyJS = require('uglify-js');
readCode(process.argv[2]) const SOURCE_POSITION = 2;
readCode(process.argv[SOURCE_POSITION]);
function readCode(inputPath) { function readCode(inputPath) {
if (fs.existsSync(inputPath)) { if (fs.existsSync(inputPath)) {
const files = fs.readdirSync(inputPath) const files = fs.readdirSync(inputPath);
files.forEach(function(file) { files.forEach(function(file) {
const filePath = path.join(inputPath, file) const filePath = path.join(inputPath, file);
if (fs.existsSync(filePath)) { if (fs.existsSync(filePath)) {
const fileStat = fs.statSync(filePath) const fileStat = fs.statSync(filePath);
if (fileStat.isFile()) { if (fileStat.isFile()) {
const code = fs.readFileSync(filePath, 'utf-8') const code = fs.readFileSync(filePath, 'utf-8');
uglifyCode(code,filePath) uglifyCode(code, filePath);
} }
if (fileStat.isDirectory()) { if (fileStat.isDirectory()) {
readCode(filePath) readCode(filePath);
} }
} }
}) });
} }
} }
function uglifyCode(code, outPath) { function uglifyCode(code, outPath) {
const uglifyCode = uglifyJS.minify(code).code const uglifyCode = uglifyJS.minify(code).code;
fs.writeFileSync(outPath, uglifyCode) fs.writeFileSync(outPath, uglifyCode);
} }