aboutsummaryrefslogtreecommitdiff
path: root/scripts/cmd/build.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cmd/build.js')
-rw-r--r--scripts/cmd/build.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js
index 3a182c656..b2d402890 100644
--- a/scripts/cmd/build.js
+++ b/scripts/cmd/build.js
@@ -26,9 +26,17 @@ export default async function build(...args) {
const patterns = args
.filter((f) => !!f) // remove empty args
.map((f) => f.replace(/^'/, '').replace(/'$/, '')); // Needed for Windows: glob strings contain surrounding string chars??? remove these
- let entryPoints = [].concat(...(await Promise.all(patterns.map((pattern) => glob(pattern, { filesOnly: true, absolute: true })))));
+ let entryPoints = [].concat(
+ ...(await Promise.all(
+ patterns.map((pattern) => glob(pattern, { filesOnly: true, absolute: true }))
+ ))
+ );
- const { type = 'module', version, dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString()));
+ const {
+ type = 'module',
+ version,
+ dependencies = {},
+ } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString()));
// expose PACKAGE_VERSION on process.env for CLI utils
config.define = { 'process.env.PACKAGE_VERSION': JSON.stringify(version) };
const format = type === 'module' ? 'esm' : 'cjs';
@@ -56,7 +64,9 @@ export default async function build(...args) {
console.error(dim(`[${date}] `) + red(error || result.errors.join('\n')));
} else {
if (result.warnings.length) {
- console.log(dim(`[${date}] `) + yellow('⚠ updated with warnings:\n' + result.warnings.join('\n')));
+ console.log(
+ dim(`[${date}] `) + yellow('⚠ updated with warnings:\n' + result.warnings.join('\n'))
+ );
}
console.log(dim(`[${date}] `) + green('✔ updated'));
}