Repository navigation
fix(pack): simplify async externals script chunk filename #2587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([ | ||
| typeof document === "object" ? document.currentScript : undefined, | ||
| {"otherChunks":["_root-of-the-server___a4c79e8f.js"],"runtimeModuleIds":[212]} | ||
| {"otherChunks":["_root-of-the-server___3b647096.js"],"runtimeModuleIds":[212]} | ||
| ]); | ||
| // Dummy runtime |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "config": { | ||
| "entry": [ | ||
| { | ||
| "import": "input/index.ts", | ||
| "name": "main" | ||
| } | ||
| ], | ||
| "externals": { | ||
| "lodash": { | ||
| "root": "_", | ||
| "type": "script", | ||
| "script": "https://gw.alipayobjects.com/os/lib/lodash/4.17.21/lodash.min.js" | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| const func = async () => { | ||
| // @ts-ignore | ||
| const _ = await import('lodash'); | ||
| console.log(Object.keys(_.default.omit({ a: 1 }, 'a')).length === 0); | ||
| }; | ||
| func(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, | ||
| 20, ((__turbopack_context__) => { | ||
| "use strict"; | ||
|
|
||
| return __turbopack_context__.a(async (__turbopack_handle_async_dependencies__, __turbopack_async_result__) => { try { | ||
|
|
||
| let mod; | ||
| try { | ||
| await __turbopack_context__.L("https://gw.alipayobjects.com/os/lib/lodash/4.17.21/lodash.min.js"); | ||
| if (typeof global["_"] === 'undefined') { | ||
| throw new Error('Variable "_" is not available on global object after loading "https://gw.alipayobjects.com/os/lib/lodash/4.17.21/lodash.min.js"'); | ||
| } | ||
| mod = global["_"]; | ||
| } catch (error) { | ||
| throw new Error('Failed to load external URL module "_@https://gw.alipayobjects.com/os/lib/lodash/4.17.21/lodash.min.js": ' + (error.message || error)); | ||
| } | ||
|
|
||
| __turbopack_context__.v(mod); | ||
| __turbopack_async_result__(); | ||
| } catch(e) { __turbopack_async_result__(e); } }, true);}), | ||
| ]); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| (globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([ | ||
| typeof document === "object" ? document.currentScript : undefined, | ||
| {"otherChunks":["_root-of-the-server___7ced73a1.js"],"runtimeModuleIds":[19]} | ||
| ]); | ||
| // Dummy runtime |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| +10 −1 | turbopack/crates/turbopack-ecmascript/src/references/external_module.rs |
Uh oh!
There was an error while loading. Please reload this page.