2020-11-26 18:44:43 +08:00
|
|
|
# example.js
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
// insert router here
|
|
|
|
|
import(`./pages/${page}`);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# pages/Dashboard.js
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
import { Button, Checkbox } from "../components";
|
|
|
|
|
|
|
|
|
|
const Dashboard = () => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button />
|
|
|
|
|
<Checkbox />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
export default Dashboard;
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# pages/Login.js
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
import { Button, Dialog } from "../components";
|
|
|
|
|
|
2020-11-29 00:30:32 +08:00
|
|
|
const Login = () => {
|
2020-11-26 18:44:43 +08:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Button />
|
|
|
|
|
<Dialog />
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
2020-11-29 00:30:32 +08:00
|
|
|
export default Login;
|
2020-11-26 18:44:43 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# components/index.js
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
export { default as Button } from "./Button";
|
|
|
|
|
export * from "./Checkbox";
|
|
|
|
|
export { default as Dialog } from "./Dialog";
|
|
|
|
|
export { DialogInline } from "./DialogInline";
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# dist/pages_Dashboard_js.output.js
|
|
|
|
|
|
|
|
|
|
```javascript
|
2021-08-20 14:12:50 +08:00
|
|
|
"use strict";
|
2020-11-26 18:44:43 +08:00
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([["pages_Dashboard_js"],{
|
|
|
|
|
|
|
|
|
|
/***/ "./components/Button.js":
|
|
|
|
|
/*!******************************!*\
|
|
|
|
|
!*** ./components/Button.js ***!
|
|
|
|
|
\******************************/
|
|
|
|
|
/*! namespace exports */
|
|
|
|
|
/*! export default [provided] [used in main] [could be renamed] */
|
|
|
|
|
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2021-08-20 14:12:50 +08:00
|
|
|
/* harmony export */ "default": () => (/* binding */ Button)
|
2020-11-26 18:44:43 +08:00
|
|
|
/* harmony export */ });
|
|
|
|
|
const Button = () => {
|
|
|
|
|
return /*#__PURE__*/React.createElement("button", null);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./components/Checkbox.js":
|
|
|
|
|
/*!********************************!*\
|
|
|
|
|
!*** ./components/Checkbox.js ***!
|
|
|
|
|
\********************************/
|
|
|
|
|
/*! namespace exports */
|
|
|
|
|
/*! export Checkbox [provided] [used in main] [could be renamed] */
|
|
|
|
|
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2025-04-25 01:57:25 +08:00
|
|
|
/* harmony export */ Checkbox: () => (/* binding */ Checkbox)
|
2020-11-26 18:44:43 +08:00
|
|
|
/* harmony export */ });
|
|
|
|
|
const Checkbox = () => {
|
|
|
|
|
return /*#__PURE__*/React.createElement("input", {
|
|
|
|
|
type: "checkbox"
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./pages/Dashboard.js":
|
|
|
|
|
/*!****************************!*\
|
|
|
|
|
!*** ./pages/Dashboard.js ***!
|
|
|
|
|
\****************************/
|
|
|
|
|
/*! namespace exports */
|
|
|
|
|
/*! export default [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] */
|
|
|
|
|
/*! other exports [not provided] [maybe used in main (runtime-defined)] */
|
|
|
|
|
/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */
|
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2021-08-20 14:12:50 +08:00
|
|
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
2020-11-26 18:44:43 +08:00
|
|
|
/* harmony export */ });
|
|
|
|
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components */ "./components/Button.js");
|
|
|
|
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components */ "./components/Checkbox.js");
|
|
|
|
|
|
|
|
|
|
const Dashboard = () => {
|
2023-04-08 06:23:22 +08:00
|
|
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_components__WEBPACK_IMPORTED_MODULE_0__["default"], null), /*#__PURE__*/React.createElement(_components__WEBPACK_IMPORTED_MODULE_1__.Checkbox, null));
|
2020-11-26 18:44:43 +08:00
|
|
|
};
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Dashboard);
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# dist/pages_Login_js.output.js
|
|
|
|
|
|
|
|
|
|
```javascript
|
2021-08-20 14:12:50 +08:00
|
|
|
"use strict";
|
2020-11-26 18:44:43 +08:00
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([["pages_Login_js"],{
|
|
|
|
|
|
|
|
|
|
/***/ "./components/Button.js":
|
|
|
|
|
/*!******************************!*\
|
|
|
|
|
!*** ./components/Button.js ***!
|
|
|
|
|
\******************************/
|
|
|
|
|
/*! namespace exports */
|
|
|
|
|
/*! export default [provided] [used in main] [could be renamed] */
|
|
|
|
|
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2021-08-20 14:12:50 +08:00
|
|
|
/* harmony export */ "default": () => (/* binding */ Button)
|
2020-11-26 18:44:43 +08:00
|
|
|
/* harmony export */ });
|
|
|
|
|
const Button = () => {
|
|
|
|
|
return /*#__PURE__*/React.createElement("button", null);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./components/Dialog.js":
|
|
|
|
|
/*!******************************!*\
|
|
|
|
|
!*** ./components/Dialog.js ***!
|
|
|
|
|
\******************************/
|
|
|
|
|
/*! namespace exports */
|
|
|
|
|
/*! export default [provided] [used in main] [could be renamed] */
|
|
|
|
|
/*! runtime requirements: __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2021-08-20 14:12:50 +08:00
|
|
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
2020-11-26 18:44:43 +08:00
|
|
|
/* harmony export */ });
|
|
|
|
|
const Dialog = ({
|
|
|
|
|
children
|
|
|
|
|
}) => {
|
|
|
|
|
return /*#__PURE__*/React.createElement("dialog", null, children);
|
|
|
|
|
};
|
|
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Dialog);
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./pages/Login.js":
|
|
|
|
|
/*!************************!*\
|
|
|
|
|
!*** ./pages/Login.js ***!
|
|
|
|
|
\************************/
|
|
|
|
|
/*! namespace exports */
|
|
|
|
|
/*! export default [provided] [maybe used in main (runtime-defined)] [usage prevents renaming] */
|
|
|
|
|
/*! other exports [not provided] [maybe used in main (runtime-defined)] */
|
|
|
|
|
/*! runtime requirements: __webpack_require__, __webpack_exports__, __webpack_require__.r, __webpack_require__.d, __webpack_require__.* */
|
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2021-08-20 14:12:50 +08:00
|
|
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
2020-11-26 18:44:43 +08:00
|
|
|
/* harmony export */ });
|
|
|
|
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components */ "./components/Button.js");
|
|
|
|
|
/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components */ "./components/Dialog.js");
|
|
|
|
|
|
2020-11-29 00:30:32 +08:00
|
|
|
const Login = () => {
|
2023-04-08 06:23:22 +08:00
|
|
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_components__WEBPACK_IMPORTED_MODULE_0__["default"], null), /*#__PURE__*/React.createElement(_components__WEBPACK_IMPORTED_MODULE_1__["default"], null));
|
2020-11-26 18:44:43 +08:00
|
|
|
};
|
2020-11-29 00:30:32 +08:00
|
|
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Login);
|
2020-11-26 18:44:43 +08:00
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```javascript
|
2025-04-25 01:57:25 +08:00
|
|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["pages_Login_js"],{"./components/Button.js":(e,t,n)=>{n.d(t,{A:()=>l});const l=()=>React.createElement("button",null)},"./pages/Login.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var l=n("./components/Button.js");const a=({children:e})=>React.createElement("dialog",null,e),c=()=>React.createElement(React.Fragment,null,React.createElement(l.A,null),React.createElement(a,null))}}]);
|
2020-11-26 18:44:43 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Info
|
|
|
|
|
|
|
|
|
|
## Unoptimized
|
|
|
|
|
|
|
|
|
|
```
|
2023-04-08 06:23:22 +08:00
|
|
|
asset output.js 11 KiB [emitted] (name: main)
|
2021-08-20 14:12:50 +08:00
|
|
|
asset pages_Login_js.output.js 2.82 KiB [emitted]
|
|
|
|
|
asset pages_Dashboard_js.output.js 2.78 KiB [emitted]
|
2025-04-25 01:57:25 +08:00
|
|
|
chunk (runtime: main) output.js (main) 208 bytes (javascript) 5.51 KiB (runtime) [entry] [rendered]
|
2020-11-26 18:44:43 +08:00
|
|
|
> ./example.js main
|
2025-04-25 01:57:25 +08:00
|
|
|
runtime modules 5.51 KiB 8 modules
|
2020-11-26 18:44:43 +08:00
|
|
|
dependent modules 160 bytes [dependent] 1 module
|
|
|
|
|
./example.js 48 bytes [built] [code generated]
|
|
|
|
|
[no exports used]
|
|
|
|
|
entry ./example.js main
|
2023-04-08 06:23:22 +08:00
|
|
|
chunk (runtime: main) pages_Dashboard_js.output.js 509 bytes [rendered]
|
2020-11-26 18:44:43 +08:00
|
|
|
> ./Dashboard ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard
|
|
|
|
|
> ./Dashboard.js ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard.js
|
2023-04-08 06:23:22 +08:00
|
|
|
dependent modules 242 bytes [dependent] 2 modules
|
|
|
|
|
./pages/Dashboard.js 267 bytes [optional] [built] [code generated]
|
2020-11-26 18:44:43 +08:00
|
|
|
[exports: default]
|
2021-08-20 14:12:50 +08:00
|
|
|
import() context element ./Dashboard ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard
|
|
|
|
|
import() context element ./Dashboard.js ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard.js
|
2023-04-08 06:23:22 +08:00
|
|
|
chunk (runtime: main) pages_Login_js.output.js 500 bytes [rendered]
|
2020-11-26 18:44:43 +08:00
|
|
|
> ./Login ./pages/ lazy ^\.\/.*$ namespace object ./Login
|
|
|
|
|
> ./Login.js ./pages/ lazy ^\.\/.*$ namespace object ./Login.js
|
2023-04-08 06:23:22 +08:00
|
|
|
dependent modules 245 bytes [dependent] 2 modules
|
|
|
|
|
./pages/Login.js 255 bytes [optional] [built] [code generated]
|
2020-11-26 18:44:43 +08:00
|
|
|
[exports: default]
|
2021-08-20 14:12:50 +08:00
|
|
|
import() context element ./Login ./pages/ lazy ^\.\/.*$ namespace object ./Login
|
|
|
|
|
import() context element ./Login.js ./pages/ lazy ^\.\/.*$ namespace object ./Login.js
|
2025-04-25 20:13:46 +08:00
|
|
|
webpack 5.99.7 compiled successfully
|
2020-11-26 18:44:43 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Production mode
|
|
|
|
|
|
|
|
|
|
```
|
2021-08-20 14:12:50 +08:00
|
|
|
asset output.js 2.49 KiB [emitted] [minimized] (name: main)
|
2023-04-08 06:23:22 +08:00
|
|
|
asset pages_Dashboard_js.output.js 450 bytes [emitted] [minimized]
|
|
|
|
|
asset pages_Login_js.output.js 444 bytes [emitted] [minimized]
|
2025-04-25 01:57:25 +08:00
|
|
|
chunk (runtime: main) output.js (main) 208 bytes (javascript) 5.51 KiB (runtime) [entry] [rendered]
|
2020-11-26 18:44:43 +08:00
|
|
|
> ./example.js main
|
2025-04-25 01:57:25 +08:00
|
|
|
runtime modules 5.51 KiB 8 modules
|
2020-11-26 18:44:43 +08:00
|
|
|
dependent modules 160 bytes [dependent] 1 module
|
|
|
|
|
./example.js 48 bytes [built] [code generated]
|
|
|
|
|
[no exports used]
|
|
|
|
|
entry ./example.js main
|
2023-04-08 06:23:22 +08:00
|
|
|
chunk (runtime: main) pages_Dashboard_js.output.js 509 bytes [rendered]
|
2020-11-26 18:44:43 +08:00
|
|
|
> ./Dashboard ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard
|
|
|
|
|
> ./Dashboard.js ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard.js
|
2023-04-08 06:23:22 +08:00
|
|
|
dependent modules 114 bytes [dependent] 1 module
|
|
|
|
|
./pages/Dashboard.js + 1 modules 395 bytes [optional] [built] [code generated]
|
2020-11-26 18:44:43 +08:00
|
|
|
[exports: default]
|
2021-08-20 14:12:50 +08:00
|
|
|
import() context element ./Dashboard ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard
|
|
|
|
|
import() context element ./Dashboard.js ./pages/ lazy ^\.\/.*$ namespace object ./Dashboard.js
|
2023-04-08 06:23:22 +08:00
|
|
|
chunk (runtime: main) pages_Login_js.output.js 500 bytes [rendered]
|
2020-11-26 18:44:43 +08:00
|
|
|
> ./Login ./pages/ lazy ^\.\/.*$ namespace object ./Login
|
|
|
|
|
> ./Login.js ./pages/ lazy ^\.\/.*$ namespace object ./Login.js
|
2023-04-08 06:23:22 +08:00
|
|
|
dependent modules 114 bytes [dependent] 1 module
|
|
|
|
|
./pages/Login.js + 1 modules 386 bytes [optional] [built] [code generated]
|
2020-11-26 18:44:43 +08:00
|
|
|
[exports: default]
|
2021-08-20 14:12:50 +08:00
|
|
|
import() context element ./Login ./pages/ lazy ^\.\/.*$ namespace object ./Login
|
|
|
|
|
import() context element ./Login.js ./pages/ lazy ^\.\/.*$ namespace object ./Login.js
|
2025-04-25 20:13:46 +08:00
|
|
|
webpack 5.99.7 compiled successfully
|
2020-11-26 18:44:43 +08:00
|
|
|
```
|