Skip to content

Commit

Permalink
Added Size Limit for node_modules (#248)
Browse files Browse the repository at this point in the history
* Added Size Limit for `node_modules`

* added test cmd to website check command
  • Loading branch information
EthanThatOneKid committed Jan 17, 2022
1 parent 38c8664 commit a1b07b5
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/check_website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ jobs:
- name: Check
run: npm run check

# info: https://etok.codes/acmcsuf.com/blob/main/CONTRIBUTING.md#npm-bloat
- name: Test Dependency Size
run: npm run test:size

- name: Build
run: npm run build
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ npm run check # Use this command to find bugs in your website code.
npm run build # Use this to make sure your code builds successfully.
```

### NPM Bloat

In this project, we set a threshold for how large the `/node_modules` folder can become after an `npm install`.
In our [`package.json`](package.json), we set the size to 50 MB.

To test the size of the dependencies in your local workspace, run `npm run test:size`.

## Architecture 🗿

For architecture-related information, please refer to [`ARCHITECTURE.md`](ARCHITECTURE.md).
Expand Down
170 changes: 170 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
"tabs": "node scripts/seek-tabs.js"
"tabs": "node scripts/seek-tabs.js",
"test:size": "npm i && size-limit"
},
"dependencies": {
"rfs": "^9.0.6",
"rrule": "^2.6.8"
},
"devDependencies": {
"@size-limit/file": "^7.0.4",
"@sveltejs/adapter-static": "next",
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "next",
Expand All @@ -41,10 +43,17 @@
"prettier": "^2.4.1",
"prettier-plugin-svelte": "^2.4.0",
"sass": "^1.42.1",
"size-limit": "^7.0.4",
"svelte": "^3.42.6",
"svelte-check": "^2.2.6",
"svelte-preprocess": "^4.9.4",
"tslib": "^2.3.1",
"typescript": "^4.4.3"
}
},
"size-limit": [
{
"path": "node_modules",
"limit": "50 MB"
}
]
}

1 comment on commit a1b07b5

@vercel
Copy link

@vercel vercel bot commented on a1b07b5 Jan 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.