
This reverts commit f9de3f6990
.
In doing so, this rescues the naomiwu design which was removed on
purpose from one branch, but then that removal commit accidentally got
merged in the branch where it was being kept.
35 lines
918 B
JavaScript
35 lines
918 B
JavaScript
/* This script will build the package with esbuild */
|
|
import esbuild from 'esbuild'
|
|
import pkg from './package.json' assert { type: 'json' }
|
|
|
|
// Create banner based on package info
|
|
const banner = `/**
|
|
* ${pkg.name} | v${pkg.version}
|
|
* ${pkg.description}
|
|
* (c) ${new Date().getFullYear()} ${pkg.author}
|
|
* @license ${pkg.license}
|
|
*/`
|
|
|
|
// Shared esbuild options
|
|
const options = {
|
|
banner: { js: banner },
|
|
bundle: true,
|
|
entryPoints: ['src/index.mjs'],
|
|
format: 'esm',
|
|
outfile: 'dist/index.mjs',
|
|
external: ['@freesewing'],
|
|
metafile: process.env.VERBOSE ? true : false,
|
|
minify: process.env.NO_MINIFY ? false : true,
|
|
sourcemap: true,
|
|
}
|
|
|
|
// Let esbuild generate the build
|
|
const build = async () => {
|
|
const result = await esbuild.build(options).catch(() => process.exit(1))
|
|
|
|
if (process.env.VERBOSE) {
|
|
const info = await esbuild.analyzeMetafile(result.metafile)
|
|
console.log(info)
|
|
}
|
|
}
|
|
build()
|