import { inc } from 'https://deno.land/std@0.151.0/semver/mod.ts';import { build, stop } from 'https://deno.land/x/esbuild@v0.14.54/mod.js';
const { readTextFile, writeTextFile } = Deno;
const pkg = JSON.parse(await readTextFile('./package.json'));pkg.version = inc(pkg.version, 'patch');await writeTextFile('./package.json', JSON.stringify(pkg, null, '\t'));
const { license, author, email, version } = pkg;
const banner = `/************************************************************************Name: XElementVersion: ${version}License: ${license}Author: ${author}Email: ${email}This Source Code Form is subject to the terms of the Mozilla PublicLicense, v. 2.0. If a copy of the MPL was not distributed with thisfile, You can obtain one at http://mozilla.org/MPL/2.0/.************************************************************************/`;
const result = await build({ minify: true, bundle: true, format: 'esm', target: 'es2020', treeShaking: true, platform: 'browser', banner: { js: banner }, outfile: './pro/out.js', tsconfig: './tsconfig.json', entryPoints: [ 'src/element/element.ts' ],});
console.log(result);
await writeTextFile('./web/x-poly.js', await readTextFile('./pro/x-poly.js'));
stop();