Skip to content

Commit c3671ba

Browse files
committed
Use ncc in favor of Vite for bundling
1 parent 1d299e0 commit c3671ba

11 files changed

Lines changed: 55629 additions & 230 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242

4343
- name: Verify build is up to date
4444
run: |
45-
if [ -n "$(git status --porcelain product/vite)" ]; then
46-
echo "Error: product/vite contains uncommitted changes after build"
47-
git diff product/vite
45+
if [ -n "$(git status --porcelain product/dist)" ]; then
46+
echo "Error: product/dist contains uncommitted changes after the build"
47+
git diff product/dist
4848
exit 1
4949
fi

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
!.gitkeep
33

44
# Project
5-
/product
6-
!/product/vite
5+
/product/*
6+
!/product/dist
77

88
# Dependencies
99
/node_modules

action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ outputs:
1616
description: 'Specifies whether the cache was restored or not.'
1717
runs:
1818
using: 'node20'
19-
main: 'product/vite/Restore.js'
20-
post: 'product/vite/Store.js'
19+
main: 'product/dist/Restore.js'
20+
post: 'product/dist/Store.js'
2121
post-if: success()
2222
branding:
2323
icon: 'hard-drive'
2424
color: 'purple'
25+

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"scripts": {
3-
"build": "vite build",
3+
"build": "npm run build:ncc && npm run build:dist",
4+
"build:ncc": "npx ncc build source/Restore.ts --out product/ncc/restore && npx ncc build source/Store.ts --out product/ncc/store",
5+
"build:dist": "cp product/ncc/restore/index.js product/dist/Restore.js && cp product/ncc/store/index.js product/dist/Store.js",
46
"test": "vitest",
57
"lint": "eslint source",
68
"typecheck": "tsc --build --force --noEmit # Build + force ensures that it's not cached and always runs…"
@@ -19,9 +21,9 @@
1921
"eslint-plugin-n": "^17.23.1",
2022
"glob": "^13.0.0",
2123
"globals": "^16.5.0",
24+
"@vercel/ncc": "^0.38.1",
2225
"typescript": "^5.9.3",
2326
"typescript-eslint": "^8.48.0",
24-
"vite": "^7.2.6",
2527
"vitest": "^4.0.14"
2628
}
2729
}

pnpm-lock.yaml

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)