-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2af8cf9
commit 7acbcdc
Showing
5 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
crates/turbopack/tests/node-file-trace/integration/webpack-target-node/chunk.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"use strict"; | ||
(() => { | ||
var exports = {}; | ||
exports.id = 829; | ||
exports.ids = [829]; | ||
exports.modules = { | ||
|
||
/***/ 354: | ||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | ||
|
||
// ESM COMPAT FLAG | ||
__webpack_require__.r(__webpack_exports__); | ||
|
||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, { | ||
"default": () => (/* binding */ handler) | ||
}); | ||
|
||
;// CONCATENATED MODULE: external "fs/promises" | ||
const promises_namespaceObject = require("fs/promises"); | ||
;// CONCATENATED MODULE: ./pages/api/users.ts | ||
|
||
// Fake users data | ||
const users = [ | ||
{ | ||
id: 1 | ||
}, | ||
{ | ||
id: 2 | ||
}, | ||
{ | ||
id: 3 | ||
} | ||
]; | ||
async function handler(_req, res) { | ||
const hello = await (0,promises_namespaceObject.readFile)(__dirname + "/hello.txt", "utf-8"); | ||
return hello; | ||
} | ||
|
||
|
||
/***/ }) | ||
|
||
}; | ||
; | ||
|
||
// load runtime | ||
var __webpack_require__ = require("./webpack-api-runtime.js"); | ||
__webpack_require__.C(exports); | ||
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) | ||
var __webpack_exports__ = (__webpack_exec__(354)); | ||
module.exports = __webpack_exports__; | ||
|
||
})(); |
1 change: 1 addition & 0 deletions
1
crates/turbopack/tests/node-file-trace/integration/webpack-target-node/hello.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello |
5 changes: 5 additions & 0 deletions
5
crates/turbopack/tests/node-file-trace/integration/webpack-target-node/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const sayHello = require('./chunk').default; | ||
|
||
sayHello().then((h) => { | ||
console.log(h) | ||
}); |
148 changes: 148 additions & 0 deletions
148
...es/turbopack/tests/node-file-trace/integration/webpack-target-node/webpack-api-runtime.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
/******/ (() => { // webpackBootstrap | ||
/******/ "use strict"; | ||
/******/ var __webpack_modules__ = ({}); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ var cachedModule = __webpack_module_cache__[moduleId]; | ||
/******/ if (cachedModule !== undefined) { | ||
/******/ return cachedModule.exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ var threw = true; | ||
/******/ try { | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | ||
/******/ threw = false; | ||
/******/ } finally { | ||
/******/ if(threw) delete __webpack_module_cache__[moduleId]; | ||
/******/ } | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = __webpack_modules__; | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/define property getters */ | ||
/******/ (() => { | ||
/******/ // define getter functions for harmony exports | ||
/******/ __webpack_require__.d = (exports, definition) => { | ||
/******/ for(var key in definition) { | ||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/ensure chunk */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.f = {}; | ||
/******/ // This file contains only the entry chunk. | ||
/******/ // The chunk loading function for additional chunks | ||
/******/ __webpack_require__.e = (chunkId) => { | ||
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { | ||
/******/ __webpack_require__.f[key](chunkId, promises); | ||
/******/ return promises; | ||
/******/ }, [])); | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/get javascript chunk filename */ | ||
/******/ (() => { | ||
/******/ // This function allow to reference async chunks and sibling chunks for the entrypoint | ||
/******/ __webpack_require__.u = (chunkId) => { | ||
/******/ // return url for filenames based on template | ||
/******/ return undefined; | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
/******/ (() => { | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = (exports) => { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/startup entrypoint */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.X = (result, chunkIds, fn) => { | ||
/******/ // arguments: chunkIds, moduleId are deprecated | ||
/******/ var moduleId = chunkIds; | ||
/******/ if(!fn) chunkIds = result, fn = () => (__webpack_require__(__webpack_require__.s = moduleId)); | ||
/******/ chunkIds.map(__webpack_require__.e, __webpack_require__) | ||
/******/ var r = fn(); | ||
/******/ return r === undefined ? result : r; | ||
/******/ } | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/require chunk loading */ | ||
/******/ (() => { | ||
/******/ // no baseURI | ||
/******/ | ||
/******/ // object to store loaded chunks | ||
/******/ // "1" means "loaded", otherwise not loaded yet | ||
/******/ var installedChunks = { | ||
/******/ 165: 1 | ||
/******/ }; | ||
/******/ | ||
/******/ // no on chunks loaded | ||
/******/ | ||
/******/ var installChunk = (chunk) => { | ||
/******/ var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime; | ||
/******/ for(var moduleId in moreModules) { | ||
/******/ if(__webpack_require__.o(moreModules, moduleId)) { | ||
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; | ||
/******/ } | ||
/******/ } | ||
/******/ if(runtime) runtime(__webpack_require__); | ||
/******/ for(var i = 0; i < chunkIds.length; i++) | ||
/******/ installedChunks[chunkIds[i]] = 1; | ||
/******/ | ||
/******/ }; | ||
/******/ | ||
/******/ // require() chunk loading for javascript | ||
/******/ __webpack_require__.f.require = (chunkId, promises) => { | ||
/******/ // "1" is the signal for "already loaded" | ||
/******/ if(!installedChunks[chunkId]) { | ||
/******/ if(165 != chunkId) { | ||
/******/ installChunk(require("./chunks/" + __webpack_require__.u(chunkId))); | ||
/******/ } else installedChunks[chunkId] = 1; | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ module.exports = __webpack_require__; | ||
/******/ __webpack_require__.C = installChunk; | ||
/******/ | ||
/******/ // no HMR | ||
/******/ | ||
/******/ // no HMR manifest | ||
/******/ })(); | ||
/******/ | ||
/************************************************************************/ | ||
/******/ | ||
/******/ | ||
/******/ })() | ||
; |