Skip to content

Commit 0ada994

Browse files
committed
fix: bundle
1 parent 24b88f4 commit 0ada994

File tree

7 files changed

+440
-54
lines changed

7 files changed

+440
-54
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ jobs:
1212
run: yarn
1313
- name: Build
1414
run: yarn build
15+
- name: Bundle
16+
run: yarn bundle

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v3
1818
- name: Install
1919
run: yarn install --frozen-lockfile
20-
- name: Build
21-
run: yarn build
20+
- name: Bundle
21+
run: yarn bundle
2222
- name: Release
2323
run: yarn release

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

package.json

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,14 @@
55
"author": "maxgfr",
66
"license": "MIT",
77
"description": "A minimalist typescript swc starter",
8-
"main": "./dist/cjs/index.js",
9-
"module": "./dist/esm/index.js",
8+
"main": "./dist/index.cjs",
109
"exports": {
1110
".": {
12-
"require": "./dist/cjs/index.js",
13-
"import": "./dist/esm/index.js"
14-
},
15-
"./dist/cjs/index.js": {
16-
"require": "./dist/cjs/index.js"
17-
},
18-
"./dist/esm/index.js": {
19-
"import": "./dist/esm/index.js"
11+
"import": "./dist/index.mjs",
12+
"require": "./dist/index.cjs"
2013
}
2114
},
15+
"types": "./dist/index.d.ts",
2216
"repository": {
2317
"type": "git",
2418
"url": "https://github.com/maxgfr/typescript-swc-starter.git"
@@ -38,28 +32,22 @@
3832
],
3933
"scripts": {
4034
"prepare": "husky install",
41-
"start:cjs": "node ./dist/cjs/index.js",
42-
"start:esm": "node --experimental-specifier-resolution=node --loader ts-node/esm ./dist/esm/index.js",
43-
"start": "node ./dist/esm/index.js",
35+
"start:cjs": "node ./dist/index.cjs",
36+
"start:esm": "node ./dist/index.mjs",
4437
"dev": "nodemon",
4538
"develop": "ts-node-esm ./src/index.ts",
4639
"test": "jest --passWithNoTests",
4740
"test:watch": "jest --watch --passWithNoTests",
4841
"clean": "rimraf build && rimraf dist",
49-
"build:cjs": "tsc -p tsconfig.build.cjs.json",
50-
"build:cjs:watch": "tsc -w -p tsconfig.build.cjs.json",
51-
"build:esm": "tsc -p tsconfig.build.esm.json",
52-
"build:esm:watch": "tsc -w -p tsconfig.build.esm.json",
53-
"build": "npm run build:cjs && npm run build:esm",
54-
"build:swc": "swc ./src -d dist",
55-
"build:swc:watch": "swc ./src -d dist -w",
56-
"build:watch": "npm run build:swc:watch",
42+
"build": "swc ./src -d dist",
43+
"build:watch": "swc ./src -d dist -w",
5744
"lint": "eslint ./src --ext .ts",
5845
"lint:fix": "eslint ./src --ext .ts --fix",
5946
"prettier": "prettier '**/*.{ts,json,md}'",
6047
"prettier:write": "prettier --write '**/*.{ts,json,md}'",
6148
"lint-staged": "lint-staged",
62-
"release": "semantic-release"
49+
"release": "semantic-release",
50+
"bundle": "unbuild"
6351
},
6452
"dependencies": {},
6553
"devDependencies": {
@@ -90,6 +78,7 @@
9078
"rimraf": "5.0.1",
9179
"semantic-release": "^21.0.2",
9280
"ts-node": "^10.9.1",
93-
"typescript": "5.0.4"
81+
"typescript": "5.0.4",
82+
"unbuild": "^1.2.1"
9483
}
9584
}

tsconfig.build.cjs.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

tsconfig.build.esm.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)