From da1b327464b78d7a6e6bacde8453cb7798b5771a Mon Sep 17 00:00:00 2001 From: hemengke1997 <49073282+hemengke1997@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:11:17 +0800 Subject: [PATCH 1/3] fix: throw esbuild error --- src/utils/index.ts | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 9df3a2b..f7ba10f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -23,31 +23,29 @@ export async function build(options: BuildOptions) { const { filePath, publicDir, esbuildOptions, outputDir } = options const fileName = path.basename(filePath, path.extname(filePath)) - try { - const res = await esbuild({ - entryPoints: [filePath], - write: false, - platform: 'browser', - bundle: true, - format: 'iife', - sourcemap: false, - treeShaking: true, - splitting: false, - minify: true, - ...esbuildOptions, - }) + const res = await esbuild({ + entryPoints: [filePath], + write: false, + platform: 'browser', + bundle: true, + format: 'iife', + sourcemap: false, + treeShaking: true, + splitting: false, + minify: true, + ...esbuildOptions, + }) - const code = res.outputFiles?.[0].text + const code = res.outputFiles?.[0].text - await deleteOldFiles({ - ...options, - publicDir, - fileName, - outputDir, - }) + await deleteOldFiles({ + ...options, + publicDir, + fileName, + outputDir, + }) - await addJsFile({ ...options, code, fileName }) - } catch {} + await addJsFile({ ...options, code, fileName }) } type TDeleteFile = { From c8cb8a32ac5c6eb6d4a0a6811602d386d2a37c9d Mon Sep 17 00:00:00 2001 From: hemengke1997 <49073282+hemengke1997@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:11:33 +0800 Subject: [PATCH 2/3] chore: changelog --- CHANGELOG.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 662413a..5a90c73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [0.0.10](https://github.com/hemengke1997/vite-plugin-public-typescript/compare/v0.0.9...v0.0.10) (2022-11-10) + + + ## [0.0.9](https://github.com/hemengke1997/vite-plugin-public-typescript/compare/v0.0.8...v0.0.9) (2022-11-09) @@ -51,13 +55,21 @@ -## [0.0.2](https://github.com/hemengke1997/vite-plugin-public-typescript/compare/2f7ecdb66a3004addbe372e91bf2caf33243e0e8...v0.0.2) (2022-11-08) +## [0.0.2](https://github.com/hemengke1997/vite-plugin-public-typescript/compare/v0.0.1...v0.0.2) (2022-11-08) ### Features -* 🎉 init ([2f7ecdb](https://github.com/hemengke1997/vite-plugin-public-typescript/commit/2f7ecdb66a3004addbe372e91bf2caf33243e0e8)) * playground ([e36ac70](https://github.com/hemengke1997/vite-plugin-public-typescript/commit/e36ac706ed1261fadbc837dd48e21fe312026826)) +## [0.0.1](https://github.com/hemengke1997/vite-plugin-public-typescript/compare/2f7ecdb66a3004addbe372e91bf2caf33243e0e8...v0.0.1) (2022-11-07) + + +### Features + +* 🎉 init ([2f7ecdb](https://github.com/hemengke1997/vite-plugin-public-typescript/commit/2f7ecdb66a3004addbe372e91bf2caf33243e0e8)) + + + From b77c816aef48e49c2432a1f9841791944fad9bd4 Mon Sep 17 00:00:00 2001 From: hemengke1997 <49073282+hemengke1997@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:11:39 +0800 Subject: [PATCH 3/3] chore: release v0.0.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c013ea6..01f302d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-public-typescript", - "version": "0.0.10", + "version": "0.0.11", "description": "vite plugin that generate public javascript from typescript file", "keywords": [ "vite",