add compiled dir

This commit is contained in:
Harvey Zack committed 2022-04-30 09:09:47 +08:00
1 parent bc838bf0f2
commit 2979fc49bc
9 files changed
+31 -3

No files matched your search

+5
View File
@@ -1,8 +1,12 @@
import fs from 'fs';
import cpy from 'cpy';
import path from 'path';
import prompts from 'prompts';
import projects from './projects.js';
import { Parcel } from '@parcel/core';
const compiledPath = path.resolve(`docs/compiled`);
async function build(name) {
const { version } = JSON.parse(fs.readFileSync(`${projects[name]}/package.json`, 'utf-8'));
process.chdir(projects[name]);
@@ -43,6 +47,7 @@ async function build(name) {
const code = banner + fs.readFileSync(filePath);
fs.writeFileSync(filePath, code.replace(/\\n*\s*</g, '<').replace(/>\\n*\s*/g, '>'));
fs.renameSync(filePath, newFilePath);
await cpy(newFilePath, compiledPath);
console.log(`✨ Built ${name} ${bundles.length} bundles in ${buildTime}ms!`);
}