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