Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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
17 changes: 17 additions & 0 deletions crates/pack-tests/tests/snapshot/externals/script/config.json
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["_"];
Comment thread
fireairforce marked this conversation as resolved.
Resolved
} 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.

2 changes: 1 addition & 1 deletion next.js
Loading