mirror of
https://gitee.com/openharmony/third_party_weex-loader
synced 2024-11-26 17:10:58 +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',
|
'@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
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user