-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Showing
34 changed files
with
19,955 additions
and
0 deletions.
There are no files selected for viewing
4,250 changes: 4,250 additions & 0 deletions
4,250
crates/swc_ecma_minifier/tests/fixture/next/next-59834/163/input.js
Large diffs are not rendered by default.
Oops, something went wrong.
2,115 changes: 2,115 additions & 0 deletions
2,115
crates/swc_ecma_minifier/tests/fixture/next/next-59834/388/input.js
Large diffs are not rendered by default.
Oops, something went wrong.
1,684 changes: 1,684 additions & 0 deletions
1,684
crates/swc_ecma_minifier/tests/fixture/next/next-59834/917/input.js
Large diffs are not rendered by default.
Oops, something went wrong.
253 changes: 253 additions & 0 deletions
253
crates/swc_ecma_minifier/tests/fixture/next/next-59834/pages/[post]/input.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,253 @@ | ||
"use strict"; | ||
(() => { | ||
var exports = {}; | ||
exports.id = 862; | ||
exports.ids = [862,660]; | ||
exports.modules = { | ||
|
||
/***/ 1323: | ||
/***/ ((__unused_webpack_module, exports) => { | ||
|
||
var __webpack_unused_export__; | ||
/** | ||
* Hoists a name from a module or promised module. | ||
* | ||
* @param module the module to hoist the name from | ||
* @param name the name to hoist | ||
* @returns the value on the module (or promised module) | ||
*/ | ||
__webpack_unused_export__ = ({ | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "l", ({ | ||
enumerable: true, | ||
get: function() { | ||
return hoist; | ||
} | ||
})); | ||
function hoist(module, name) { | ||
// If the name is available in the module, return it. | ||
if (name in module) { | ||
return module[name]; | ||
} | ||
// If a property called `then` exists, assume it's a promise and | ||
// return a promise that resolves to the name. | ||
if ("then" in module && typeof module.then === "function") { | ||
return module.then((mod)=>hoist(mod, name)); | ||
} | ||
// If we're trying to hoise the default export, and the module is a function, | ||
// return the module itself. | ||
if (typeof module === "function" && name === "default") { | ||
return module; | ||
} | ||
// Otherwise, return undefined. | ||
return undefined; | ||
} | ||
|
||
//# sourceMappingURL=helpers.js.map | ||
|
||
/***/ }), | ||
|
||
/***/ 5669: | ||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | ||
|
||
// ESM COMPAT FLAG | ||
__webpack_require__.r(__webpack_exports__); | ||
|
||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, { | ||
config: () => (/* binding */ config), | ||
"default": () => (/* binding */ next_route_loaderkind_PAGES_page_2F_5Bpost_5D_preferredRegion_absolutePagePath_private_next_pages_2F_5Bpost_5D_js_absoluteAppPath_next_2Fdist_2Fpages_2F_app_absoluteDocumentPath_next_2Fdist_2Fpages_2F_document_middlewareConfigBase64_e30_3D_), | ||
getServerSideProps: () => (/* binding */ getServerSideProps), | ||
getStaticPaths: () => (/* binding */ getStaticPaths), | ||
getStaticProps: () => (/* binding */ getStaticProps), | ||
reportWebVitals: () => (/* binding */ reportWebVitals), | ||
routeModule: () => (/* binding */ routeModule), | ||
unstable_getServerProps: () => (/* binding */ unstable_getServerProps), | ||
unstable_getServerSideProps: () => (/* binding */ unstable_getServerSideProps), | ||
unstable_getStaticParams: () => (/* binding */ unstable_getStaticParams), | ||
unstable_getStaticPaths: () => (/* binding */ unstable_getStaticPaths), | ||
unstable_getStaticProps: () => (/* binding */ unstable_getStaticProps) | ||
}); | ||
|
||
// NAMESPACE OBJECT: ./pages/[post].js | ||
var _post_namespaceObject = {}; | ||
__webpack_require__.r(_post_namespaceObject); | ||
__webpack_require__.d(_post_namespaceObject, { | ||
"default": () => (Page) | ||
}); | ||
|
||
// EXTERNAL MODULE: ./node_modules/next/dist/server/future/route-modules/pages/module.compiled.js | ||
var module_compiled = __webpack_require__(7093); | ||
// EXTERNAL MODULE: ./node_modules/next/dist/server/future/route-kind.js | ||
var route_kind = __webpack_require__(5244); | ||
// EXTERNAL MODULE: ./node_modules/next/dist/build/templates/helpers.js | ||
var helpers = __webpack_require__(1323); | ||
// EXTERNAL MODULE: ./node_modules/next/dist/pages/_document.js | ||
var _document = __webpack_require__(5388); | ||
var _document_default = /*#__PURE__*/__webpack_require__.n(_document); | ||
// EXTERNAL MODULE: ./node_modules/next/dist/pages/_app.js | ||
var _app = __webpack_require__(6769); | ||
var _app_default = /*#__PURE__*/__webpack_require__.n(_app); | ||
;// CONCATENATED MODULE: ./pages/[post].js | ||
function Page() { | ||
return "hi from post"; | ||
} | ||
|
||
;// CONCATENATED MODULE: ./node_modules/next/dist/build/webpack/loaders/next-route-loader/index.js?kind=PAGES&page=%2F%5Bpost%5D&preferredRegion=&absolutePagePath=private-next-pages%2F%5Bpost%5D.js&absoluteAppPath=next%2Fdist%2Fpages%2F_app&absoluteDocumentPath=next%2Fdist%2Fpages%2F_document&middlewareConfigBase64=e30%3D! | ||
|
||
|
||
|
||
// Import the app and document modules. | ||
|
||
|
||
// Import the userland code. | ||
|
||
// Re-export the component (should be the default export). | ||
/* harmony default export */ const next_route_loaderkind_PAGES_page_2F_5Bpost_5D_preferredRegion_absolutePagePath_private_next_pages_2F_5Bpost_5D_js_absoluteAppPath_next_2Fdist_2Fpages_2F_app_absoluteDocumentPath_next_2Fdist_2Fpages_2F_document_middlewareConfigBase64_e30_3D_ = ((0,helpers/* hoist */.l)(_post_namespaceObject, "default")); | ||
// Re-export methods. | ||
const getStaticProps = (0,helpers/* hoist */.l)(_post_namespaceObject, "getStaticProps"); | ||
const getStaticPaths = (0,helpers/* hoist */.l)(_post_namespaceObject, "getStaticPaths"); | ||
const getServerSideProps = (0,helpers/* hoist */.l)(_post_namespaceObject, "getServerSideProps"); | ||
const config = (0,helpers/* hoist */.l)(_post_namespaceObject, "config"); | ||
const reportWebVitals = (0,helpers/* hoist */.l)(_post_namespaceObject, "reportWebVitals"); | ||
// Re-export legacy methods. | ||
const unstable_getStaticProps = (0,helpers/* hoist */.l)(_post_namespaceObject, "unstable_getStaticProps"); | ||
const unstable_getStaticPaths = (0,helpers/* hoist */.l)(_post_namespaceObject, "unstable_getStaticPaths"); | ||
const unstable_getStaticParams = (0,helpers/* hoist */.l)(_post_namespaceObject, "unstable_getStaticParams"); | ||
const unstable_getServerProps = (0,helpers/* hoist */.l)(_post_namespaceObject, "unstable_getServerProps"); | ||
const unstable_getServerSideProps = (0,helpers/* hoist */.l)(_post_namespaceObject, "unstable_getServerSideProps"); | ||
// Create and export the route module that will be consumed. | ||
const routeModule = new module_compiled.PagesRouteModule({ | ||
definition: { | ||
kind: route_kind/* RouteKind */.x.PAGES, | ||
page: "/[post]", | ||
pathname: "/[post]", | ||
// The following aren't used in production. | ||
bundlePath: "", | ||
filename: "" | ||
}, | ||
components: { | ||
App: (_app_default()), | ||
Document: (_document_default()) | ||
}, | ||
userland: _post_namespaceObject | ||
}); | ||
|
||
//# sourceMappingURL=pages.js.map | ||
|
||
/***/ }), | ||
|
||
/***/ 6769: | ||
/***/ ((module, exports, __webpack_require__) => { | ||
|
||
|
||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
})); | ||
Object.defineProperty(exports, "default", ({ | ||
enumerable: true, | ||
get: function() { | ||
return App; | ||
} | ||
})); | ||
const _interop_require_default = __webpack_require__(167); | ||
const _react = /*#__PURE__*/ _interop_require_default._(__webpack_require__(6689)); | ||
const _utils = __webpack_require__(6221); | ||
/** | ||
* `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization. | ||
* This allows for keeping state between navigation, custom error handling, injecting additional data. | ||
*/ async function appGetInitialProps(param) { | ||
let { Component, ctx } = param; | ||
const pageProps = await (0, _utils.loadGetInitialProps)(Component, ctx); | ||
return { | ||
pageProps | ||
}; | ||
} | ||
class App extends _react.default.Component { | ||
render() { | ||
const { Component, pageProps } = this.props; | ||
return /*#__PURE__*/ _react.default.createElement(Component, pageProps); | ||
} | ||
} | ||
App.origGetInitialProps = appGetInitialProps; | ||
App.getInitialProps = appGetInitialProps; | ||
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { | ||
Object.defineProperty(exports.default, "__esModule", { | ||
value: true | ||
}); | ||
Object.assign(exports.default, exports); | ||
module.exports = exports.default; | ||
} //# sourceMappingURL=_app.js.map | ||
|
||
|
||
/***/ }), | ||
|
||
/***/ 5244: | ||
/***/ ((__unused_webpack_module, exports) => { | ||
|
||
var __webpack_unused_export__; | ||
|
||
__webpack_unused_export__ = ({ | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "x", ({ | ||
enumerable: true, | ||
get: function() { | ||
return RouteKind; | ||
} | ||
})); | ||
var RouteKind; | ||
(function(RouteKind) { | ||
RouteKind[/** | ||
* `PAGES` represents all the React pages that are under `pages/`. | ||
*/ "PAGES"] = "PAGES"; | ||
RouteKind[/** | ||
* `PAGES_API` represents all the API routes under `pages/api/`. | ||
*/ "PAGES_API"] = "PAGES_API"; | ||
RouteKind[/** | ||
* `APP_PAGE` represents all the React pages that are under `app/` with the | ||
* filename of `page.{j,t}s{,x}`. | ||
*/ "APP_PAGE"] = "APP_PAGE"; | ||
RouteKind[/** | ||
* `APP_ROUTE` represents all the API routes and metadata routes that are under `app/` with the | ||
* filename of `route.{j,t}s{,x}`. | ||
*/ "APP_ROUTE"] = "APP_ROUTE"; | ||
})(RouteKind || (RouteKind = {})); | ||
|
||
//# sourceMappingURL=route-kind.js.map | ||
|
||
/***/ }), | ||
|
||
/***/ 2785: | ||
/***/ ((module) => { | ||
|
||
module.exports = require("next/dist/compiled/next-server/pages.runtime.prod.js"); | ||
|
||
/***/ }), | ||
|
||
/***/ 6689: | ||
/***/ ((module) => { | ||
|
||
module.exports = require("react"); | ||
|
||
/***/ }), | ||
|
||
/***/ 1017: | ||
/***/ ((module) => { | ||
|
||
module.exports = require("path"); | ||
|
||
/***/ }) | ||
|
||
}; | ||
; | ||
|
||
// load runtime | ||
var __webpack_require__ = require("../webpack-runtime.js"); | ||
__webpack_require__.C(exports); | ||
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) | ||
var __webpack_exports__ = __webpack_require__.X(0, [388], () => (__webpack_exec__(5669))); | ||
module.exports = __webpack_exports__; | ||
|
||
})(); |
Oops, something went wrong.