Commit 64efdad
authored
[Turbopack] fix import.meta.url in monorepo (vercel#72612)
### What?
fixes the computation of `import.meta.url` inside of monorepos (when the root_path != project_path)
### How?
We add a new argument to the ChunkingContext that represents the relative path from the output folder to the root of the monorepo. Since they are on different filesystems, we can't compute them from the values alone.1 parent e79be05 commit 64efdad
File tree
164 files changed
+262
-135
lines changed- crates
- next-api/src
- next-core/src
- next_client
- next_edge
- next_server
- test/e2e/app-dir/non-root-project-monorepo
- apps/web/app
- import-meta-url-rsc
- import-meta-url-ssr
- turbopack/crates
- turbopack-browser/src
- ecmascript/evaluate
- turbopack-cli/src
- build
- dev
- turbopack-core/src/chunk
- turbopack-ecmascript-runtime
- js/src
- nodejs
- src
- turbopack-ecmascript/src/references/esm
- turbopack-nodejs/src
- ecmascript/node/entry
- turbopack-tests/tests
- snapshot
- basic-tree-shake
- dynamic-import/output
- export-named/output
- export-namespace/output
- import-named-all/output
- import-named/output
- import-namespace/output
- import-side-effect/output
- require-side-effect/output
- tree-shake-test-1/output
- basic
- async_chunk_build/output
- async_chunk/output
- chunked/output
- ecmascript_minify/output
- shebang/output
- top-level-await/output
- comptime
- define/output
- early-return/output
- typeof/output
- unreachable/output
- cssmodules
- composes/output
- relative-uri-import/output
- css
- absolute-uri-import/output
- chained-attributes/output
- css-legacy-nesting/output
- css-modules/output
- css/output
- relative-uri-import/output
- scss/output
- url-in-supports-query/output
- dynamic-request/very-dynamic/output
- emotion/emotion/output
- env/env/output
- evaluated_entrry/runtime_entry/output
- example/example/output
- export-alls
- cjs-2/output
- cjs-script/output
- import-meta
- cjs/output
- esm-multiple/output
- esm-mutable/output
- esm-object/output
- esm/output
- url/output
- imports
- duplicate-binding/output
- dynamic/output
- ignore-comments/output
- json/output
- order/output
- resolve_error_cjs/output
- resolve_error_esm/output
- static-and-dynamic/output
- static/output
- subpath-imports-nested/output
- subpath-imports/output
- mdx/error/output
- minification/paren-remover/output
- node
- node_protocol_external/output
- spawn_dynamic/output
- spawn_node_eval/output
- runtime
- default_build_runtime/output
- default_dev_runtime/output
- styled_components/styled_components/output
- swc_transforms
- mono_transforms/output
- preset_env/output
- tree-shaking/dce/output
- typescript
- jsconfig-baseurl/output
- tsconfig-baseurl/output
- tsconfig-extends-module-full-path/output
- tsconfig-extends-module/output
- tsconfig-extends-relative-dir/output
- tsconfig-extends-without-ext/output
- tsconfig-extends/output
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
164 files changed
+262
-135
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
650 | 662 | | |
651 | 663 | | |
652 | 664 | | |
| |||
695 | 707 | | |
696 | 708 | | |
697 | 709 | | |
| 710 | + | |
698 | 711 | | |
699 | 712 | | |
700 | 713 | | |
| |||
822 | 835 | | |
823 | 836 | | |
824 | 837 | | |
| 838 | + | |
825 | 839 | | |
826 | 840 | | |
827 | 841 | | |
| |||
840 | 854 | | |
841 | 855 | | |
842 | 856 | | |
| 857 | + | |
843 | 858 | | |
844 | 859 | | |
845 | 860 | | |
| |||
851 | 866 | | |
852 | 867 | | |
853 | 868 | | |
| 869 | + | |
854 | 870 | | |
855 | 871 | | |
856 | 872 | | |
| |||
868 | 884 | | |
869 | 885 | | |
870 | 886 | | |
| 887 | + | |
871 | 888 | | |
872 | 889 | | |
873 | 890 | | |
| |||
879 | 896 | | |
880 | 897 | | |
881 | 898 | | |
| 899 | + | |
882 | 900 | | |
883 | 901 | | |
884 | 902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
| 403 | + | |
403 | 404 | | |
404 | 405 | | |
405 | 406 | | |
| |||
408 | 409 | | |
409 | 410 | | |
410 | 411 | | |
411 | | - | |
| 412 | + | |
412 | 413 | | |
| 414 | + | |
413 | 415 | | |
414 | 416 | | |
415 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | | - | |
| 216 | + | |
216 | 217 | | |
| 218 | + | |
217 | 219 | | |
218 | 220 | | |
219 | 221 | | |
| |||
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
240 | | - | |
| 242 | + | |
241 | 243 | | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
250 | | - | |
| 253 | + | |
251 | 254 | | |
| 255 | + | |
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
| 979 | + | |
979 | 980 | | |
980 | 981 | | |
981 | 982 | | |
| |||
989 | 990 | | |
990 | 991 | | |
991 | 992 | | |
| 993 | + | |
992 | 994 | | |
993 | 995 | | |
994 | 996 | | |
| |||
1021 | 1023 | | |
1022 | 1024 | | |
1023 | 1025 | | |
| 1026 | + | |
1024 | 1027 | | |
1025 | 1028 | | |
1026 | 1029 | | |
| |||
1032 | 1035 | | |
1033 | 1036 | | |
1034 | 1037 | | |
| 1038 | + | |
1035 | 1039 | | |
1036 | 1040 | | |
1037 | 1041 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
51 | 83 | | |
52 | 84 | | |
53 | 85 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
| |||
154 | 156 | | |
155 | 157 | | |
156 | 158 | | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | 174 | | |
| |||
286 | 290 | | |
287 | 291 | | |
288 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
289 | 298 | | |
290 | 299 | | |
291 | 300 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | | - | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 192 | + | |
| 193 | + | |
197 | 194 | | |
198 | 195 | | |
199 | 196 | | |
200 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
201 | 204 | | |
202 | 205 | | |
203 | | - | |
| 206 | + | |
204 | 207 | | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
220 | | - | |
| 224 | + | |
221 | 225 | | |
222 | 226 | | |
223 | 227 | | |
| |||
0 commit comments