Commit 0ce8e2c
authored
fix: do not follow absolute paths outside job base (#568)
related to
sveltejs/kit#13764 (comment)
SvelteKit stringifies environment variables during build so that it can
inject static values into the build output instead of always reading the
env vars dynamically. However, `@vercel/nft` interprets any absolute
path as an asset it should add. This causes builds on Vercel's build
system to balloon in function size because it traces and bundles paths
such as Node, Yarn global, etc. Often, this causes the deployment to
fail because the function size exceeds the limit.
This PR ensures asset paths outside the given job base are ignored to
help us avoid packaging in system dependencies.
~Draft for now because I'm not confident that this fix doesn't break
lots of other things~1 parent 8f6a609 commit 0ce8e2c
13 files changed
Lines changed: 58 additions & 0 deletions
File tree
- src
- test/unit
- pkg-dir-outside-base
- node_modules/some-pkg
- secret-dir
- pkg-file-outside-base
- node_modules/some-pkg
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1172 | 1192 | | |
| 1193 | + | |
| 1194 | + | |
1173 | 1195 | | |
1174 | 1196 | | |
| 1197 | + | |
| 1198 | + | |
1175 | 1199 | | |
1176 | 1200 | | |
1177 | 1201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments