From e010b98c530c2961034dc3b54189d334a317a671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 9 Aug 2021 17:00:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=BA=E5=A4=A7=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.js | 15 +++++++++++++++ package.json | 13 +++++++------ src/{index.es7 => index.js} | 0 src/lib/{format.es7 => format.js} | 0 src/{next.es7 => next.js} | 0 5 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 build.js rename src/{index.es7 => index.js} (100%) rename src/lib/{format.es7 => format.js} (100%) rename src/{next.es7 => next.js} (100%) diff --git a/build.js b/build.js new file mode 100644 index 0000000..209de5d --- /dev/null +++ b/build.js @@ -0,0 +1,15 @@ +/** + * {build} + * @author yutent + * @date 2021/08/09 11:59:41 + */ + +const Es = require('esbuild') + +Es.build({ + entryPoints: ['src/index.js', 'src/next.js'], + bundle: true, + minify: true, + format: 'esm', + outdir: 'dist' +}) diff --git a/package.json b/package.json index f8fa785..080e0be 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,11 @@ { "name": "@bytedo/fetch", - "version": "1.1.1", + "version": "1.1.2", "description": "全新的ajax封装。分2个版本, 一个基于XMLHttpRequest, 一个基于window.fetch", "main": "dist/index.js", - "directories": { - "lib": "dist/lib" - }, + "files": ["dist/*"], "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node ./build.js" }, "repository": { "type": "git", @@ -19,5 +17,8 @@ "bugs": { "url": "https://github.com/bytedo/fetch/issues" }, - "homepage": "https://github.com/bytedo/fetch#readme" + "homepage": "https://github.com/bytedo/fetch#readme", + "devDependencies": { + "esbuild": "^0.12.19" + } } diff --git a/src/index.es7 b/src/index.js similarity index 100% rename from src/index.es7 rename to src/index.js diff --git a/src/lib/format.es7 b/src/lib/format.js similarity index 100% rename from src/lib/format.es7 rename to src/lib/format.js diff --git a/src/next.es7 b/src/next.js similarity index 100% rename from src/next.es7 rename to src/next.js