diff --git a/config/esbuild.config.mjs b/config/esbuild.config.mjs deleted file mode 100644 index d95af82..0000000 --- a/config/esbuild.config.mjs +++ /dev/null @@ -1,40 +0,0 @@ -import esbuild from 'esbuild'; - -const commonOptions = { - outdir: 'dist', - format: 'esm', - bundle: true, - loader: { - '.svg': 'file', - '.woff': 'file', - '.woff2': 'file', - '.ttf': 'file', - '.otf': 'file', - '.html': 'copy', - '.json': 'copy', - }, - logLevel: 'info', - entryPoints: [], -}; - -if (process.env.NODE_ENV === 'production') { - commonOptions.entryPoints.push('src/index.js'); - await esbuild.build({ - ...commonOptions, - entryPoints: ['src/index.js'], - minify: true, - sourcemap: false, - }).catch(() => process.exit(1)); -} else { - commonOptions.entryPoints.push('example/index.html', 'example/index.js'); - let ctx = await esbuild.context({ - ...commonOptions, - minify: false, - sourcemap: true, - }) - - let { host, port } = await ctx.serve({ - servedir: commonOptions.outdir, - }); - await ctx.watch(); -} diff --git a/package.json b/package.json index f0b81c3..df97261 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "geojson-dev": "rm -fr dist && install -d dist && NODE_ENV=development node config/esbuild.geojson.mjs", - "geojson-build": "rm -fr dist && install -d dist && NODE_ENV=production node config/esbuild.geojson.mjs", + "build": "rm -fr dist && install -d dist && NODE_ENV=production node config/esbuild.geojson.mjs", "lint": "ESLINT_USE_FLAT_CONFIG=true eslint -c config/eslint.config.mjs --cache --fix ./src/**/*.js", "docs": "jsdoc -c config/jsdoc.config.json" },