mirror of https://github.com/webpack/webpack.git
docs: update examples (#19663)
This commit is contained in:
parent
a11302288d
commit
b4dfee432d
|
@ -29,6 +29,8 @@ a big file...
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const { AggressiveMergingPlugin } = require("../..").optimize;
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ function createImageElement(title, src) {
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const svgToMiniDataURI = require("mini-svg-data-uri");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -40,6 +40,8 @@ function createImageElement(title, src) {
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
output: {
|
||||
assetModuleFilename: "images/[hash][ext]"
|
||||
|
|
|
@ -14,6 +14,8 @@ console.log(pMap4);
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// enable debug logging to see network requests!
|
||||
// stats: {
|
||||
|
|
|
@ -18,6 +18,8 @@ import("./async2");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -3,6 +3,8 @@ This example shows how to use Code Splitting with entrypoint dependOn
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: { import: "./app.js", dependOn: ["other-vendors"] },
|
||||
|
|
|
@ -3,6 +3,8 @@ This example shows how to use Code Splitting with entrypoint dependOn
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: { import: "./app.js", dependOn: ["react-vendors"] },
|
||||
|
|
|
@ -34,6 +34,8 @@ With this bundle configuration, you would load your third party libraries, then
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -83,6 +83,7 @@ module.exports = function() {
|
|||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -62,8 +62,10 @@ document.querySelector('#app').innerHTML = [toml, yaml, json].map(data => `
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
const toml = require("toml");
|
||||
"use strict";
|
||||
|
||||
const json5 = require("json5");
|
||||
const toml = require("toml");
|
||||
const yaml = require("yamljs");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -34,6 +34,8 @@ export { c } from "./cjs";
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("../../");
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ This is the _user_ bundle, which uses the manifest from [dll-reference example](
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("../../");
|
||||
|
||||
|
@ -47,18 +49,18 @@ console.log(require("module"));
|
|||
/* 0 */,
|
||||
/* 1 */
|
||||
/*!**************************************************************************!*\
|
||||
!*** delegated ./alpha.js from dll-reference alpha_2239422b902ff2ef1cc1 ***!
|
||||
!*** delegated ./alpha.js from dll-reference alpha_a1d5c7116e082d77ec3e ***!
|
||||
\**************************************************************************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: module, __webpack_require__ */
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1cc1 */ 2))(1);
|
||||
module.exports = (__webpack_require__(/*! dll-reference alpha_a1d5c7116e082d77ec3e */ 2))(1);
|
||||
|
||||
/***/ }),
|
||||
/* 2 */
|
||||
/*!*********************************************!*\
|
||||
!*** external "alpha_2239422b902ff2ef1cc1" ***!
|
||||
!*** external "alpha_a1d5c7116e082d77ec3e" ***!
|
||||
\*********************************************/
|
||||
/*! dynamic exports */
|
||||
/*! exports [maybe provided (runtime-defined)] [no usage info] */
|
||||
|
@ -66,34 +68,34 @@ module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1c
|
|||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = alpha_2239422b902ff2ef1cc1;
|
||||
module.exports = alpha_a1d5c7116e082d77ec3e;
|
||||
|
||||
/***/ }),
|
||||
/* 3 */
|
||||
/*!**********************************************************************!*\
|
||||
!*** delegated ./a.js from dll-reference alpha_2239422b902ff2ef1cc1 ***!
|
||||
!*** delegated ./a.js from dll-reference alpha_a1d5c7116e082d77ec3e ***!
|
||||
\**********************************************************************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: module, __webpack_require__ */
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1cc1 */ 2))(2);
|
||||
module.exports = (__webpack_require__(/*! dll-reference alpha_a1d5c7116e082d77ec3e */ 2))(2);
|
||||
|
||||
/***/ }),
|
||||
/* 4 */
|
||||
/*!************************************************************************!*\
|
||||
!*** delegated ./beta.js from dll-reference beta_2239422b902ff2ef1cc1 ***!
|
||||
!*** delegated ./beta.js from dll-reference beta_a1d5c7116e082d77ec3e ***!
|
||||
\************************************************************************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: module, __webpack_require__ */
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc1 */ 5))(5);
|
||||
module.exports = (__webpack_require__(/*! dll-reference beta_a1d5c7116e082d77ec3e */ 5))(5);
|
||||
|
||||
/***/ }),
|
||||
/* 5 */
|
||||
/*!********************************************!*\
|
||||
!*** external "beta_2239422b902ff2ef1cc1" ***!
|
||||
!*** external "beta_a1d5c7116e082d77ec3e" ***!
|
||||
\********************************************/
|
||||
/*! dynamic exports */
|
||||
/*! exports [maybe provided (runtime-defined)] [no usage info] */
|
||||
|
@ -101,40 +103,40 @@ module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc
|
|||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = beta_2239422b902ff2ef1cc1;
|
||||
module.exports = beta_a1d5c7116e082d77ec3e;
|
||||
|
||||
/***/ }),
|
||||
/* 6 */
|
||||
/*!*********************************************************************!*\
|
||||
!*** delegated ./b.js from dll-reference beta_2239422b902ff2ef1cc1 ***!
|
||||
!*** delegated ./b.js from dll-reference beta_a1d5c7116e082d77ec3e ***!
|
||||
\*********************************************************************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: module, __webpack_require__ */
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc1 */ 5))(6);
|
||||
module.exports = (__webpack_require__(/*! dll-reference beta_a1d5c7116e082d77ec3e */ 5))(6);
|
||||
|
||||
/***/ }),
|
||||
/* 7 */
|
||||
/*!**********************************************************************!*\
|
||||
!*** delegated ./c.jsx from dll-reference beta_2239422b902ff2ef1cc1 ***!
|
||||
!*** delegated ./c.jsx from dll-reference beta_a1d5c7116e082d77ec3e ***!
|
||||
\**********************************************************************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: module, __webpack_require__ */
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
module.exports = (__webpack_require__(/*! dll-reference beta_2239422b902ff2ef1cc1 */ 5))(7);
|
||||
module.exports = (__webpack_require__(/*! dll-reference beta_a1d5c7116e082d77ec3e */ 5))(7);
|
||||
|
||||
/***/ }),
|
||||
/* 8 */
|
||||
/*!*****************************************************************************************!*\
|
||||
!*** delegated ../node_modules/module.js from dll-reference alpha_2239422b902ff2ef1cc1 ***!
|
||||
!*** delegated ../node_modules/module.js from dll-reference alpha_a1d5c7116e082d77ec3e ***!
|
||||
\*****************************************************************************************/
|
||||
/*! unknown exports (runtime-defined) */
|
||||
/*! runtime requirements: module, __webpack_require__ */
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
module.exports = (__webpack_require__(/*! dll-reference alpha_2239422b902ff2ef1cc1 */ 2))(3);
|
||||
module.exports = (__webpack_require__(/*! dll-reference alpha_a1d5c7116e082d77ec3e */ 2))(3);
|
||||
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
|
|
|
@ -7,6 +7,8 @@ This is the _reference_ bundle (with the manifests) for [dll user example](https
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("../../");
|
||||
|
||||
|
@ -36,7 +38,7 @@ module.exports = {
|
|||
# dist/MyDll.alpha.js
|
||||
|
||||
```javascript
|
||||
var alpha_2239422b902ff2ef1cc1;
|
||||
var alpha_a1d5c7116e082d77ec3e;
|
||||
/******/ (() => { // webpackBootstrap
|
||||
/******/ var __webpack_modules__ = ([
|
||||
/* 0 */
|
||||
|
@ -129,7 +131,7 @@ module.exports = "module";
|
|||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module doesn't tell about it's top-level declarations so it can't be inlined
|
||||
/******/ var __webpack_exports__ = __webpack_require__(0);
|
||||
/******/ alpha_2239422b902ff2ef1cc1 = __webpack_exports__;
|
||||
/******/ alpha_a1d5c7116e082d77ec3e = __webpack_exports__;
|
||||
/******/
|
||||
/******/ })()
|
||||
;
|
||||
|
@ -138,7 +140,7 @@ module.exports = "module";
|
|||
# dist/alpha-manifest.json
|
||||
|
||||
```javascript
|
||||
{"name":"alpha_2239422b902ff2ef1cc1","content":{"./alpha.js":{"id":1,"buildMeta":{}},"./a.js":{"id":2,"buildMeta":{}},"../node_modules/module.js":{"id":3,"buildMeta":{}}}}
|
||||
{"name":"alpha_a1d5c7116e082d77ec3e","content":{"./alpha.js":{"id":1,"buildMeta":{}},"./a.js":{"id":2,"buildMeta":{}},"../node_modules/module.js":{"id":3,"buildMeta":{}}}}
|
||||
```
|
||||
|
||||
# Info
|
||||
|
@ -155,9 +157,9 @@ chunk (runtime: alpha) MyDll.alpha.js (alpha) 85 bytes [entry] [rendered]
|
|||
[used exports unknown]
|
||||
dll entry
|
||||
used as library export
|
||||
chunk (runtime: beta) MyDll.beta.js (beta) 80 bytes [entry] [rendered]
|
||||
chunk (runtime: beta) MyDll.beta.js (beta) 81 bytes [entry] [rendered]
|
||||
> beta
|
||||
dependent modules 68 bytes [dependent] 3 modules
|
||||
dependent modules 69 bytes [dependent] 3 modules
|
||||
dll beta 12 bytes [built] [code generated]
|
||||
[used exports unknown]
|
||||
dll entry
|
||||
|
@ -170,9 +172,9 @@ webpack X.X.X compiled successfully
|
|||
```
|
||||
asset MyDll.alpha.js 313 bytes [emitted] [minimized] (name: alpha)
|
||||
asset MyDll.beta.js 307 bytes [emitted] [minimized] (name: beta)
|
||||
chunk (runtime: beta) MyDll.beta.js (beta) 80 bytes [entry] [rendered]
|
||||
chunk (runtime: beta) MyDll.beta.js (beta) 81 bytes [entry] [rendered]
|
||||
> beta
|
||||
dependent modules 68 bytes [dependent] 3 modules
|
||||
dependent modules 69 bytes [dependent] 3 modules
|
||||
dll beta 12 bytes [built] [code generated]
|
||||
dll entry
|
||||
used as library export
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("../../");
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ exports.exampleValue = subtract(add(42, 2), 2);
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// mode: "development" || "production",
|
||||
output: {
|
||||
|
|
|
@ -22,6 +22,8 @@ require.ensure(["./a", "./e"], function(require) {
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// mode: "development" || "production",
|
||||
optimization: {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -17,6 +17,8 @@ The compression improves with bigger `maxSize`, as gzip works better for bigger
|
|||
The backward compatibility (non-HTTP2 client) improves with bigger `maxSize`, as the number of requests decreases.
|
||||
|
||||
```js
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("../../");
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -42,6 +42,8 @@ document.body.appendChild(pre);
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const { HotModuleReplacementPlugin } = require("../../");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -25,6 +25,8 @@ Note: decreasing `maxInitial/AsyncRequest` will increase duplication further to
|
|||
## webpack.config.js
|
||||
|
||||
```
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const { ModuleFederationPlugin } = require("../../").container;
|
||||
|
||||
const rules = [
|
||||
{
|
||||
test: /\.js$/,
|
||||
|
@ -25,6 +28,7 @@ const stats = {
|
|||
chunkModules: true,
|
||||
chunkOrigins: true
|
||||
};
|
||||
|
||||
module.exports = (env = "development") => [
|
||||
// For this example we have 3 configs in a single file
|
||||
// In practice you probably would have separate config
|
||||
|
|
|
@ -10,6 +10,8 @@ console.log("Running " + ENV + " build");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const webpack = require("../../");
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ Note: When your library has dependencies that should not be included in the comp
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -50,6 +50,8 @@ require.ensure(["./shared"], function(require) {
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// mode: "development" || "production",
|
||||
entry: {
|
||||
|
|
|
@ -23,6 +23,8 @@ console.log(myModule.exports.hello());
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// mode: "development" || "production",
|
||||
target: "node",
|
||||
|
|
|
@ -17,7 +17,10 @@ console.log(_);
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = (env = "development") => ({
|
||||
mode: env,
|
||||
infrastructureLogging: {
|
||||
|
|
|
@ -99,6 +99,8 @@ export var y = "y";
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
// mode: "development" || "production",
|
||||
optimization: {
|
||||
|
|
|
@ -19,6 +19,8 @@ race = (winner, runners...) ->
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = [
|
||||
|
|
|
@ -11,6 +11,8 @@ console.log("Hello World!");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -11,6 +11,8 @@ console.log("Hello World!");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -11,6 +11,8 @@ console.log("Hello World!");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -11,6 +11,8 @@ console.log("Hello World!");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -11,6 +11,8 @@ console.log("Hello World!");
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -203,9 +203,12 @@ const AlternativeCreateUserAction = async name => {
|
|||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/async module */
|
||||
/******/ (() => {
|
||||
/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/ var hasSymbol = typeof Symbol === "function";
|
||||
/******/ var webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/
|
||||
/******/
|
||||
/******/ var resolveQueue = (queue) => {
|
||||
/******/ if(queue && queue.d < 1) {
|
||||
/******/ queue.d = 1;
|
||||
|
@ -215,6 +218,7 @@ const AlternativeCreateUserAction = async name => {
|
|||
/******/ }
|
||||
/******/ var wrapDeps = (deps) => (deps.map((dep) => {
|
||||
/******/ if(dep !== null && typeof dep === "object") {
|
||||
/******/
|
||||
/******/ if(dep[webpackQueues]) return dep;
|
||||
/******/ if(dep.then) {
|
||||
/******/ var queue = [];
|
||||
|
@ -227,6 +231,7 @@ const AlternativeCreateUserAction = async name => {
|
|||
/******/ resolveQueue(queue);
|
||||
/******/ });
|
||||
/******/ var obj = {};
|
||||
/******/
|
||||
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
||||
/******/ return obj;
|
||||
/******/ }
|
||||
|
@ -251,10 +256,11 @@ const AlternativeCreateUserAction = async name => {
|
|||
/******/ promise[webpackExports] = exports;
|
||||
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
||||
/******/ module.exports = promise;
|
||||
/******/ body((deps) => {
|
||||
/******/ var handle = (deps) => {
|
||||
/******/ currentDeps = wrapDeps(deps);
|
||||
/******/ var fn;
|
||||
/******/ var getResult = () => (currentDeps.map((d) => {
|
||||
/******/
|
||||
/******/ if(d[webpackError]) throw d[webpackError];
|
||||
/******/ return d[webpackExports];
|
||||
/******/ }))
|
||||
|
@ -265,7 +271,9 @@ const AlternativeCreateUserAction = async name => {
|
|||
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
||||
/******/ });
|
||||
/******/ return fn.r ? promise : getResult();
|
||||
/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
|
||||
/******/ }
|
||||
/******/ var done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
||||
/******/ body(handle, done);
|
||||
/******/ queue && queue.d < 0 && (queue.d = 0);
|
||||
/******/ };
|
||||
/******/ })();
|
||||
|
@ -579,7 +587,7 @@ __webpack_async_result__();
|
|||
## Unoptimized
|
||||
|
||||
```
|
||||
asset output.js 15 KiB [emitted] (name: main)
|
||||
asset output.js 15.1 KiB [emitted] (name: main)
|
||||
asset UserApi_js.output.js 2.97 KiB [emitted]
|
||||
chunk (runtime: main) UserApi_js.output.js 617 bytes [rendered]
|
||||
> ./UserApi.js ./Actions.js 22:30-52
|
||||
|
@ -590,9 +598,9 @@ chunk (runtime: main) UserApi_js.output.js 617 bytes [rendered]
|
|||
[used exports unknown]
|
||||
import() ./UserApi.js ./Actions.js 2:16-38
|
||||
import() ./UserApi.js ./Actions.js 22:30-52
|
||||
chunk (runtime: main) output.js (main) 1.19 KiB (javascript) 7.56 KiB (runtime) [entry] [rendered]
|
||||
chunk (runtime: main) output.js (main) 1.19 KiB (javascript) 7.59 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 7.56 KiB 9 modules
|
||||
runtime modules 7.59 KiB 9 modules
|
||||
dependent modules 1.09 KiB [dependent] 1 module
|
||||
./example.js 103 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
@ -604,7 +612,7 @@ webpack X.X.X compiled successfully
|
|||
## Production mode
|
||||
|
||||
```
|
||||
asset output.js 2.93 KiB [emitted] [minimized] (name: main)
|
||||
asset output.js 2.89 KiB [emitted] [minimized] (name: main)
|
||||
asset UserApi_js.output.js 532 bytes [emitted] [minimized]
|
||||
chunk (runtime: main) UserApi_js.output.js 617 bytes [rendered]
|
||||
> ./UserApi.js ./Actions.js 22:30-52
|
||||
|
@ -614,9 +622,9 @@ chunk (runtime: main) UserApi_js.output.js 617 bytes [rendered]
|
|||
[exports: createUser]
|
||||
import() ./UserApi.js ./example.js + 1 modules ./Actions.js 2:16-38
|
||||
import() ./UserApi.js ./example.js + 1 modules ./Actions.js 22:30-52
|
||||
chunk (runtime: main) output.js (main) 1.19 KiB (javascript) 7.56 KiB (runtime) [entry] [rendered]
|
||||
chunk (runtime: main) output.js (main) 1.19 KiB (javascript) 7.59 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 7.56 KiB 9 modules
|
||||
runtime modules 7.59 KiB 9 modules
|
||||
./example.js + 1 modules 1.19 KiB [built] [code generated]
|
||||
[no exports]
|
||||
[no exports used]
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -21,6 +21,8 @@ console.log(getArray(1, 2, 3));
|
|||
# webpack.config.js
|
||||
|
||||
```javascript
|
||||
"use strict";
|
||||
|
||||
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
||||
|
||||
module.exports = (env = "development") => ({
|
||||
|
|
|
@ -218,9 +218,12 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f
|
|||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/async module */
|
||||
/******/ (() => {
|
||||
/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/ var hasSymbol = typeof Symbol === "function";
|
||||
/******/ var webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/
|
||||
/******/
|
||||
/******/ var resolveQueue = (queue) => {
|
||||
/******/ if(queue && queue.d < 1) {
|
||||
/******/ queue.d = 1;
|
||||
|
@ -230,6 +233,7 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f
|
|||
/******/ }
|
||||
/******/ var wrapDeps = (deps) => (deps.map((dep) => {
|
||||
/******/ if(dep !== null && typeof dep === "object") {
|
||||
/******/
|
||||
/******/ if(dep[webpackQueues]) return dep;
|
||||
/******/ if(dep.then) {
|
||||
/******/ var queue = [];
|
||||
|
@ -242,6 +246,7 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f
|
|||
/******/ resolveQueue(queue);
|
||||
/******/ });
|
||||
/******/ var obj = {};
|
||||
/******/
|
||||
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
||||
/******/ return obj;
|
||||
/******/ }
|
||||
|
@ -266,10 +271,11 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f
|
|||
/******/ promise[webpackExports] = exports;
|
||||
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
||||
/******/ module.exports = promise;
|
||||
/******/ body((deps) => {
|
||||
/******/ var handle = (deps) => {
|
||||
/******/ currentDeps = wrapDeps(deps);
|
||||
/******/ var fn;
|
||||
/******/ var getResult = () => (currentDeps.map((d) => {
|
||||
/******/
|
||||
/******/ if(d[webpackError]) throw d[webpackError];
|
||||
/******/ return d[webpackExports];
|
||||
/******/ }))
|
||||
|
@ -280,7 +286,9 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f
|
|||
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
||||
/******/ });
|
||||
/******/ return fn.r ? promise : getResult();
|
||||
/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
|
||||
/******/ }
|
||||
/******/ var done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
||||
/******/ body(handle, done);
|
||||
/******/ queue && queue.d < 0 && (queue.d = 0);
|
||||
/******/ };
|
||||
/******/ })();
|
||||
|
@ -369,10 +377,10 @@ module.exports = __webpack_require__.v(exports, module.id, "ffe21e855d11d22ab54f
|
|||
|
||||
```
|
||||
asset ffe21e855d11d22ab54f.wasm 14.8 KiB [emitted] [immutable] (auxiliary name: main)
|
||||
asset output.js 13.4 KiB [emitted] (name: main)
|
||||
chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.68 KiB (runtime) [entry] [rendered]
|
||||
asset output.js 13.6 KiB [emitted] (name: main)
|
||||
chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.72 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 3.68 KiB 6 modules
|
||||
runtime modules 3.72 KiB 6 modules
|
||||
dependent modules 2.97 KiB (javascript) 14.8 KiB (webassembly) [dependent] 2 modules
|
||||
./example.js 69 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
@ -385,10 +393,10 @@ webpack X.X.X compiled successfully
|
|||
|
||||
```
|
||||
asset 78eeb14b9b5e2c77fb0a.wasm 14.8 KiB [emitted] [immutable] (auxiliary name: main)
|
||||
asset output.js 3.37 KiB [emitted] [minimized] (name: main)
|
||||
chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.42 KiB (runtime) [entry] [rendered]
|
||||
asset output.js 3.33 KiB [emitted] [minimized] (name: main)
|
||||
chunk (runtime: main) output.js (main) 3.03 KiB (javascript) 14.8 KiB (webassembly) 3.45 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 3.42 KiB 5 modules
|
||||
runtime modules 3.45 KiB 5 modules
|
||||
dependent modules 2.97 KiB (javascript) 14.8 KiB (webassembly) [dependent] 2 modules
|
||||
./example.js 69 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
|
|
@ -262,9 +262,12 @@ function getRandomNumber() {
|
|||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/async module */
|
||||
/******/ (() => {
|
||||
/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/ var hasSymbol = typeof Symbol === "function";
|
||||
/******/ var webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/
|
||||
/******/
|
||||
/******/ var resolveQueue = (queue) => {
|
||||
/******/ if(queue && queue.d < 1) {
|
||||
/******/ queue.d = 1;
|
||||
|
@ -274,6 +277,7 @@ function getRandomNumber() {
|
|||
/******/ }
|
||||
/******/ var wrapDeps = (deps) => (deps.map((dep) => {
|
||||
/******/ if(dep !== null && typeof dep === "object") {
|
||||
/******/
|
||||
/******/ if(dep[webpackQueues]) return dep;
|
||||
/******/ if(dep.then) {
|
||||
/******/ var queue = [];
|
||||
|
@ -286,6 +290,7 @@ function getRandomNumber() {
|
|||
/******/ resolveQueue(queue);
|
||||
/******/ });
|
||||
/******/ var obj = {};
|
||||
/******/
|
||||
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
||||
/******/ return obj;
|
||||
/******/ }
|
||||
|
@ -310,10 +315,11 @@ function getRandomNumber() {
|
|||
/******/ promise[webpackExports] = exports;
|
||||
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
||||
/******/ module.exports = promise;
|
||||
/******/ body((deps) => {
|
||||
/******/ var handle = (deps) => {
|
||||
/******/ currentDeps = wrapDeps(deps);
|
||||
/******/ var fn;
|
||||
/******/ var getResult = () => (currentDeps.map((d) => {
|
||||
/******/
|
||||
/******/ if(d[webpackError]) throw d[webpackError];
|
||||
/******/ return d[webpackExports];
|
||||
/******/ }))
|
||||
|
@ -324,7 +330,9 @@ function getRandomNumber() {
|
|||
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
||||
/******/ });
|
||||
/******/ return fn.r ? promise : getResult();
|
||||
/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
|
||||
/******/ }
|
||||
/******/ var done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
||||
/******/ body(handle, done);
|
||||
/******/ queue && queue.d < 0 && (queue.d = 0);
|
||||
/******/ };
|
||||
/******/ })();
|
||||
|
@ -412,11 +420,11 @@ function getRandomNumber() {
|
|||
## Unoptimized
|
||||
|
||||
```
|
||||
asset output.js 13.8 KiB [emitted] (name: main)
|
||||
asset output.js 14 KiB [emitted] (name: main)
|
||||
asset daa529a2a650ee3943a9.module.wasm 139 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.69 KiB (runtime) [entry] [rendered]
|
||||
chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.72 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 3.69 KiB 6 modules
|
||||
runtime modules 3.72 KiB 6 modules
|
||||
dependent modules 449 bytes (javascript) 139 bytes (webassembly) [dependent] 4 modules
|
||||
./example.js 247 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
@ -428,11 +436,11 @@ webpack X.X.X compiled successfully
|
|||
## Production mode
|
||||
|
||||
```
|
||||
asset output.js 2.76 KiB [emitted] [minimized] (name: main)
|
||||
asset output.js 2.72 KiB [emitted] [minimized] (name: main)
|
||||
asset 03b5e050bc920dbbb73e.module.wasm 139 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.42 KiB (runtime) [entry] [rendered]
|
||||
chunk (runtime: main) output.js (main) 696 bytes (javascript) 139 bytes (webassembly) 3.46 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 3.42 KiB 5 modules
|
||||
runtime modules 3.46 KiB 5 modules
|
||||
dependent modules 449 bytes (javascript) 139 bytes (webassembly) [dependent] 4 modules
|
||||
./example.js 247 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
|
|
@ -225,9 +225,12 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da
|
|||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/async module */
|
||||
/******/ (() => {
|
||||
/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/ var hasSymbol = typeof Symbol === "function";
|
||||
/******/ var webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
||||
/******/ var webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
||||
/******/ var webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
||||
/******/
|
||||
/******/
|
||||
/******/ var resolveQueue = (queue) => {
|
||||
/******/ if(queue && queue.d < 1) {
|
||||
/******/ queue.d = 1;
|
||||
|
@ -237,6 +240,7 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da
|
|||
/******/ }
|
||||
/******/ var wrapDeps = (deps) => (deps.map((dep) => {
|
||||
/******/ if(dep !== null && typeof dep === "object") {
|
||||
/******/
|
||||
/******/ if(dep[webpackQueues]) return dep;
|
||||
/******/ if(dep.then) {
|
||||
/******/ var queue = [];
|
||||
|
@ -249,6 +253,7 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da
|
|||
/******/ resolveQueue(queue);
|
||||
/******/ });
|
||||
/******/ var obj = {};
|
||||
/******/
|
||||
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
||||
/******/ return obj;
|
||||
/******/ }
|
||||
|
@ -273,10 +278,11 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da
|
|||
/******/ promise[webpackExports] = exports;
|
||||
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
||||
/******/ module.exports = promise;
|
||||
/******/ body((deps) => {
|
||||
/******/ var handle = (deps) => {
|
||||
/******/ currentDeps = wrapDeps(deps);
|
||||
/******/ var fn;
|
||||
/******/ var getResult = () => (currentDeps.map((d) => {
|
||||
/******/
|
||||
/******/ if(d[webpackError]) throw d[webpackError];
|
||||
/******/ return d[webpackExports];
|
||||
/******/ }))
|
||||
|
@ -287,7 +293,9 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da
|
|||
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
||||
/******/ });
|
||||
/******/ return fn.r ? promise : getResult();
|
||||
/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
|
||||
/******/ }
|
||||
/******/ var done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
||||
/******/ body(handle, done);
|
||||
/******/ queue && queue.d < 0 && (queue.d = 0);
|
||||
/******/ };
|
||||
/******/ })();
|
||||
|
@ -375,13 +383,13 @@ module.exports = __webpack_require__.v(exports, module.id, "5a6637e8d63cdf9c72da
|
|||
## Unoptimized
|
||||
|
||||
```
|
||||
asset output.js 13.2 KiB [emitted] (name: main)
|
||||
asset output.js 13.3 KiB [emitted] (name: main)
|
||||
asset 5a6637e8d63cdf9c72da.wasm 67 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
asset 35a58b7c95860d720a3c.wasm 62 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
asset 0eaeab8b9fa3cef100d1.wasm 41 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.68 KiB (runtime) [entry] [rendered]
|
||||
chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.72 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 3.68 KiB 6 modules
|
||||
runtime modules 3.72 KiB 6 modules
|
||||
dependent modules 552 bytes (javascript) 170 bytes (webassembly) [dependent] 4 modules
|
||||
./example.js 753 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
@ -393,13 +401,13 @@ webpack X.X.X compiled successfully
|
|||
## Production mode
|
||||
|
||||
```
|
||||
asset output.js 2.85 KiB [emitted] [minimized] (name: main)
|
||||
asset output.js 2.8 KiB [emitted] [minimized] (name: main)
|
||||
asset 93de874acf2fa7def7d9.wasm 67 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
asset 5055869d769f484de216.wasm 62 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
asset db91ebd6538fd6985888.wasm 41 bytes [emitted] [immutable] (auxiliary name: main)
|
||||
chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.42 KiB (runtime) [entry] [rendered]
|
||||
chunk (runtime: main) output.js (main) 1.27 KiB (javascript) 170 bytes (webassembly) 3.45 KiB (runtime) [entry] [rendered]
|
||||
> ./example.js main
|
||||
runtime modules 3.42 KiB 5 modules
|
||||
runtime modules 3.45 KiB 5 modules
|
||||
dependent modules 552 bytes (javascript) 170 bytes (webassembly) [dependent] 4 modules
|
||||
./example.js 753 bytes [built] [code generated]
|
||||
[no exports]
|
||||
|
|
Loading…
Reference in New Issue