Skip to content

Commit

Permalink
fix side-effects example
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Hargrove authored and sokra committed Jan 25, 2019
1 parent 2fe0ba5 commit 780c17e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 60 deletions.
85 changes: 25 additions & 60 deletions examples/side-effects/README.md
Expand Up @@ -158,21 +158,24 @@ export { c } from "./c";

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var big_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! big-module */ 1);
/* harmony import */ var big_module_with_flag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! big-module-with-flag */ 5);
/* harmony import */ var big_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! big-module */ 3);
/* harmony import */ var big_module_with_flag__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! big-module-with-flag */ 7);
/* harmony import */ var big_module_with_flag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! big-module-with-flag */ 8);



console.log(
big_module__WEBPACK_IMPORTED_MODULE_0__["a"],
big_module__WEBPACK_IMPORTED_MODULE_0__["b"],
big_module_with_flag__WEBPACK_IMPORTED_MODULE_1__["a"],
big_module_with_flag__WEBPACK_IMPORTED_MODULE_1__["b"]
big_module_with_flag__WEBPACK_IMPORTED_MODULE_2__["b"]
);


/***/ }),
/* 1 */
/* 1 */,
/* 2 */,
/* 3 */
/*!******************************************!*\
!*** ./node_modules/big-module/index.js ***!
\******************************************/
Expand All @@ -181,13 +184,13 @@ console.log(

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */ 2);
/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */ 4);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _a__WEBPACK_IMPORTED_MODULE_0__["a"]; });

/* harmony import */ var _b__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./b */ 3);
/* harmony import */ var _b__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./b */ 5);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _b__WEBPACK_IMPORTED_MODULE_1__["b"]; });

/* harmony import */ var _c__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./c */ 4);
/* harmony import */ var _c__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./c */ 6);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _c__WEBPACK_IMPORTED_MODULE_2__["c"]; });


Expand All @@ -196,7 +199,7 @@ __webpack_require__.r(__webpack_exports__);


/***/ }),
/* 2 */
/* 4 */
/*!**************************************!*\
!*** ./node_modules/big-module/a.js ***!
\**************************************/
Expand All @@ -210,7 +213,7 @@ const a = "a";


/***/ }),
/* 3 */
/* 5 */
/*!**************************************!*\
!*** ./node_modules/big-module/b.js ***!
\**************************************/
Expand All @@ -224,7 +227,7 @@ const b = "b";


/***/ }),
/* 4 */
/* 6 */
/*!**************************************!*\
!*** ./node_modules/big-module/c.js ***!
\**************************************/
Expand All @@ -238,31 +241,7 @@ const c = "c";


/***/ }),
/* 5 */
/*!****************************************************!*\
!*** ./node_modules/big-module-with-flag/index.js ***!
\****************************************************/
/*! exports provided: a, b, c */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */ 6);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _a__WEBPACK_IMPORTED_MODULE_0__["a"]; });

/* harmony import */ var _b__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./b */ 7);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _b__WEBPACK_IMPORTED_MODULE_1__["b"]; });

/* harmony import */ var _c__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./c */ 8);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _c__WEBPACK_IMPORTED_MODULE_2__["c"]; });






/***/ }),
/* 6 */
/* 7 */
/*!************************************************!*\
!*** ./node_modules/big-module-with-flag/a.js ***!
\************************************************/
Expand All @@ -276,7 +255,7 @@ const a = "a";


/***/ }),
/* 7 */
/* 8 */
/*!************************************************!*\
!*** ./node_modules/big-module-with-flag/b.js ***!
\************************************************/
Expand All @@ -289,20 +268,6 @@ __webpack_require__.r(__webpack_exports__);
const b = "b";


/***/ }),
/* 8 */
/*!************************************************!*\
!*** ./node_modules/big-module-with-flag/c.js ***!
\************************************************/
/*! exports provided: c */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return c; });
const c = "c";


/***/ })
/******/ ]);
```
Expand All @@ -313,33 +278,33 @@ const c = "c";

```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack 4.28.0
Version: webpack 4.29.0
Asset Size Chunks Chunk Names
output.js 8.85 KiB 0 [emitted] main
output.js 7.51 KiB 0 [emitted] main
Entrypoint main = output.js
chunk {0} output.js (main) 422 bytes [entry] [rendered]
> .\example.js main
chunk {0} output.js (main) 325 bytes [entry] [rendered]
> ./example.js main
[0] ./example.js 140 bytes {0} [built]
[no exports]
single entry .\example.js main
+ 8 hidden modules
single entry ./example.js main
+ 6 hidden modules
```

## Production mode

```
Hash: 0a1b2c3d4e5f6a7b8c9d
Version: webpack 4.28.0
Version: webpack 4.29.0
Asset Size Chunks Chunk Names
output.js 985 bytes 0 [emitted] main
Entrypoint main = output.js
chunk {0} output.js (main) 325 bytes [entry] [rendered]
> .\example.js main
> ./example.js main
[0] ./example.js + 6 modules 325 bytes {0} [built]
[no exports]
single entry .\example.js main
single entry ./example.js main
| ./example.js 140 bytes [built]
| [no exports]
| single entry .\example.js main
| single entry ./example.js main
| + 6 hidden modules
```
5 changes: 5 additions & 0 deletions examples/side-effects/webpack.config.js
@@ -0,0 +1,5 @@
module.exports = {
optimization: {
sideEffects: true
}
};

0 comments on commit 780c17e

Please sign in to comment.