Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async function() {
await mkdir(path.resolve(`.licia/packages/licia-uglify`));
const _keys = keys(modData);
for (let i = 0, len = _keys.length; i < len; i++) {
const key = _keys[i];
const data = modData[key];
if (!contain(data.env, 'browser') && !contain(data.env, 'miniprogram'))
continue;
const srcPath = path.resolve(`.licia/packages/licia/${key}.js`);
const output = uglifyJs.minify(await fs.readFile(srcPath, 'utf8'));
if (output.error) {
console.log(`Something wrong with ${key}: ${output.error}`);
process.exit(1);
}
const outputPath = path.resolve(
`.licia/packages/licia-uglify/${key}.js`
);
await fs.writeFile(outputPath, output.code, 'utf8');
async function updateDoc() {
await eustiaBuild({
include: keys(output),
enableLog: true,
library: '$_abcdefghijklmnopqrstuvwxyz'
.split('')
.map(val => 'src/' + val),
output: '.licia/testUtil/doc.js',
ts: true
});
await eustiaDoc({
input: '.licia/testUtil/doc.js',
format: 'md',
title: 'Licia Documentation',
output: OUTPUT_DOC_PATH
});
let doc = await fs.readFile(OUTPUT_DOC_PATH, 'utf8');
doc = doc.replace(regTsIgnore, '');
await fs.writeFile(OUTPUT_DOC_PATH, doc, 'utf8');