1
0
Fork 0

chore: Migrated build script template to v3

This commit is contained in:
Joost De Cock 2022-08-27 13:27:33 +02:00
parent 25bbca5fb2
commit 64a627a458

View file

@ -1,20 +1,20 @@
/* This script will build the package with esbuild */ /* This script will build the package with esbuild */
import esbuild from 'esbuild' import esbuild from 'esbuild'
import pkg from './package.json' assert { type: 'json' } import { version, name, description, author, license } from './package.json' assert { type: 'json' }
// Create banner based on package info // Create banner based on package info
const banner = `/** const banner = `/**
* ${pkg.name} | v${pkg.version} * ${name} | v${version}
* ${pkg.description} * ${description}
* (c) ${new Date().getFullYear()} ${pkg.author} * (c) ${new Date().getFullYear()} ${author}
* @license ${pkg.license} * @license ${license}
*/` */`
// Shared esbuild options // Shared esbuild options
const options = { const options = {
banner: { js: banner }, banner: { js: banner },
bundle: true, bundle: true,
entryPoints: ['src/index.js'], entryPoints: ['src/index.mjs'],
format: 'esm', format: 'esm',
outfile: 'dist/index.mjs', outfile: 'dist/index.mjs',
external: ["@freesewing"], external: ["@freesewing"],