Skip to content

Commit a829f16

Browse files
committed
Add production build without sourcemaps
1 parent 40c7550 commit a829f16

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.github/workflows/nodejs-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
- name: Lint Markdown
3131
run: yarn run lint:md
3232

33-
- name: Build
34-
run: yarn run build
33+
- name: Build with sourcemaps
34+
run: yarn run build:dev
3535

3636
- name: Upload build
3737
uses: actions/upload-artifact@v4

lib/tsconfig.prod.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"sourceMap": false,
5+
"declaration": true
6+
}
7+
}
8+

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,23 @@
8484
},
8585
"scripts": {
8686
"clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map'",
87-
"compile-lib": "tsc -p lib",
87+
"compile-lib:dev": "tsc -p lib/tsconfig.json",
88+
"compile-lib:prod": "tsc -p lib/tsconfig.prod.json",
8889
"compile-test": "tsc -p test",
89-
"compile": "yarn run compile-lib && yarn run compile-test",
90+
"compile:dev": "yarn run compile-lib:dev && yarn run compile-test",
91+
"compile:prod": "yarn run compile-lib:prod && yarn run compile-test",
9092
"lint:md": "remark -u preset-lint-recommended .",
9193
"lint:ts": "biome check",
9294
"lint:fix": "biome check --write",
9395
"lint": "yarn run lint:md && yarn run lint:ts",
9496
"test": "mocha",
95-
"build": "yarn run clean && yarn run compile",
97+
"build:dev": "yarn run clean && yarn run compile:dev",
98+
"build:prod": "yarn run clean && yarn run compile:prod",
99+
"build": "yarn run build:prod",
96100
"start": "yarn run compile && yarn run lint && yarn run cover-test",
97101
"test-coverage": "c8 yarn run test",
98102
"send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
99-
"prepublishOnly": "yarn run build",
103+
"prepublishOnly": "yarn run build:prod",
100104
"update-biome": "yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write && npm run lint:fix"
101105
},
102106
"nyc": {

0 commit comments

Comments
 (0)