Skip to content

Commit

Permalink
Update: ESbuild commonjs for browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaqim committed Jun 12, 2023
1 parent bc98827 commit 8d33b0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
21 changes: 0 additions & 21 deletions .vscode/settings.json

This file was deleted.

4 changes: 3 additions & 1 deletion esbuild.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ const esbuild = require("esbuild");

esbuild.buildSync({
entryPoints: ["src/index.ts"],
format: "cjs",
platform: "browser",
outdir: "dist/cjs",
bundle: true,
sourcemap: true,
minify: true,
platform: "node",
target: ["node14"],
target: ["chrome58", "firefox57", "safari11"],
});
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
"name": "tslib-esbuild",
"version": "1.0.1",
"description": "",
"type": "commonjs",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
"node": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
},
"default": "./dist/esm/index.js"
},
"main": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts",
"type": "commonjs",
"files": [
"./dist/csj/index.js",
"./dist/esm/index.js",
"./dist/cjs/index.d.ts"
],
"scripts": {
"ts-types:esm": " tsc -p tsconfig.json --emitDeclarationOnly --outDir dist/esm",
"ts-types:cjs": " tsc -p tsconfig.cjs.json --emitDeclarationOnly --outDir dist/cjs",
Expand Down Expand Up @@ -52,4 +60,4 @@
"engines": {
"node": ">=16"
}
}
}

0 comments on commit 8d33b0c

Please sign in to comment.