mirror of
https://gitee.com/openharmony/third_party_weex-loader
synced 2024-11-27 01:20:23 +00:00
Differences in synchronization codes between blue and yellow areas
Signed-off-by: lixinnan <lixinnan1@huawei.com> Change-Id: Id182fcf273124aea23f16ed2d6b745d36f5bc3ac
This commit is contained in:
parent
34e6bd5fbd
commit
fcee5cd05a
@ -31,7 +31,7 @@ module.exports = function(api) {
|
||||
'@babel/plugin-transform-arrow-functions',
|
||||
{spec: true},
|
||||
]
|
||||
]
|
||||
];
|
||||
plugins.push(...liteArray);
|
||||
}
|
||||
return {
|
||||
@ -40,4 +40,3 @@ module.exports = function(api) {
|
||||
comments: false
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -13,32 +13,33 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const uglifyJS = require('uglify-js')
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const uglifyJS = require('uglify-js');
|
||||
|
||||
readCode(process.argv[2])
|
||||
const SOURCE_POSITION = 2;
|
||||
readCode(process.argv[SOURCE_POSITION]);
|
||||
|
||||
function readCode(inputPath) {
|
||||
if (fs.existsSync(inputPath)) {
|
||||
const files = fs.readdirSync(inputPath)
|
||||
const files = fs.readdirSync(inputPath);
|
||||
files.forEach(function(file) {
|
||||
const filePath = path.join(inputPath, file)
|
||||
const filePath = path.join(inputPath, file);
|
||||
if (fs.existsSync(filePath)) {
|
||||
const fileStat = fs.statSync(filePath)
|
||||
const fileStat = fs.statSync(filePath);
|
||||
if (fileStat.isFile()) {
|
||||
const code = fs.readFileSync(filePath, 'utf-8')
|
||||
uglifyCode(code,filePath)
|
||||
const code = fs.readFileSync(filePath, 'utf-8');
|
||||
uglifyCode(code, filePath);
|
||||
}
|
||||
if (fileStat.isDirectory()) {
|
||||
readCode(filePath)
|
||||
readCode(filePath);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function uglifyCode(code, outPath) {
|
||||
const uglifyCode = uglifyJS.minify(code).code
|
||||
fs.writeFileSync(outPath, uglifyCode)
|
||||
const uglifyCode = uglifyJS.minify(code).code;
|
||||
fs.writeFileSync(outPath, uglifyCode);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user