Skip to content

Commit 780c17e

Browse files
Steven Hargrovesokra
authored andcommitted
fix side-effects example
1 parent 2fe0ba5 commit 780c17e

File tree

2 files changed

+30
-60
lines changed

2 files changed

+30
-60
lines changed

examples/side-effects/README.md

Lines changed: 25 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,24 @@ export { c } from "./c";
158158

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

164165

165166

166167
console.log(
167168
big_module__WEBPACK_IMPORTED_MODULE_0__["a"],
168169
big_module__WEBPACK_IMPORTED_MODULE_0__["b"],
169170
big_module_with_flag__WEBPACK_IMPORTED_MODULE_1__["a"],
170-
big_module_with_flag__WEBPACK_IMPORTED_MODULE_1__["b"]
171+
big_module_with_flag__WEBPACK_IMPORTED_MODULE_2__["b"]
171172
);
172173

173174

174175
/***/ }),
175-
/* 1 */
176+
/* 1 */,
177+
/* 2 */,
178+
/* 3 */
176179
/*!******************************************!*\
177180
!*** ./node_modules/big-module/index.js ***!
178181
\******************************************/
@@ -181,13 +184,13 @@ console.log(
181184

182185
"use strict";
183186
__webpack_require__.r(__webpack_exports__);
184-
/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */ 2);
187+
/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */ 4);
185188
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _a__WEBPACK_IMPORTED_MODULE_0__["a"]; });
186189

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

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

193196

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

197200

198201
/***/ }),
199-
/* 2 */
202+
/* 4 */
200203
/*!**************************************!*\
201204
!*** ./node_modules/big-module/a.js ***!
202205
\**************************************/
@@ -210,7 +213,7 @@ const a = "a";
210213

211214

212215
/***/ }),
213-
/* 3 */
216+
/* 5 */
214217
/*!**************************************!*\
215218
!*** ./node_modules/big-module/b.js ***!
216219
\**************************************/
@@ -224,7 +227,7 @@ const b = "b";
224227

225228

226229
/***/ }),
227-
/* 4 */
230+
/* 6 */
228231
/*!**************************************!*\
229232
!*** ./node_modules/big-module/c.js ***!
230233
\**************************************/
@@ -238,31 +241,7 @@ const c = "c";
238241

239242

240243
/***/ }),
241-
/* 5 */
242-
/*!****************************************************!*\
243-
!*** ./node_modules/big-module-with-flag/index.js ***!
244-
\****************************************************/
245-
/*! exports provided: a, b, c */
246-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
247-
248-
"use strict";
249-
__webpack_require__.r(__webpack_exports__);
250-
/* harmony import */ var _a__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./a */ 6);
251-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _a__WEBPACK_IMPORTED_MODULE_0__["a"]; });
252-
253-
/* harmony import */ var _b__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./b */ 7);
254-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _b__WEBPACK_IMPORTED_MODULE_1__["b"]; });
255-
256-
/* harmony import */ var _c__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./c */ 8);
257-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _c__WEBPACK_IMPORTED_MODULE_2__["c"]; });
258-
259-
260-
261-
262-
263-
264-
/***/ }),
265-
/* 6 */
244+
/* 7 */
266245
/*!************************************************!*\
267246
!*** ./node_modules/big-module-with-flag/a.js ***!
268247
\************************************************/
@@ -276,7 +255,7 @@ const a = "a";
276255

277256

278257
/***/ }),
279-
/* 7 */
258+
/* 8 */
280259
/*!************************************************!*\
281260
!*** ./node_modules/big-module-with-flag/b.js ***!
282261
\************************************************/
@@ -289,20 +268,6 @@ __webpack_require__.r(__webpack_exports__);
289268
const b = "b";
290269

291270

292-
/***/ }),
293-
/* 8 */
294-
/*!************************************************!*\
295-
!*** ./node_modules/big-module-with-flag/c.js ***!
296-
\************************************************/
297-
/*! exports provided: c */
298-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
299-
300-
"use strict";
301-
__webpack_require__.r(__webpack_exports__);
302-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return c; });
303-
const c = "c";
304-
305-
306271
/***/ })
307272
/******/ ]);
308273
```
@@ -313,33 +278,33 @@ const c = "c";
313278

314279
```
315280
Hash: 0a1b2c3d4e5f6a7b8c9d
316-
Version: webpack 4.28.0
281+
Version: webpack 4.29.0
317282
Asset Size Chunks Chunk Names
318-
output.js 8.85 KiB 0 [emitted] main
283+
output.js 7.51 KiB 0 [emitted] main
319284
Entrypoint main = output.js
320-
chunk {0} output.js (main) 422 bytes [entry] [rendered]
321-
> .\example.js main
285+
chunk {0} output.js (main) 325 bytes [entry] [rendered]
286+
> ./example.js main
322287
[0] ./example.js 140 bytes {0} [built]
323288
[no exports]
324-
single entry .\example.js main
325-
+ 8 hidden modules
289+
single entry ./example.js main
290+
+ 6 hidden modules
326291
```
327292

328293
## Production mode
329294

330295
```
331296
Hash: 0a1b2c3d4e5f6a7b8c9d
332-
Version: webpack 4.28.0
297+
Version: webpack 4.29.0
333298
Asset Size Chunks Chunk Names
334299
output.js 985 bytes 0 [emitted] main
335300
Entrypoint main = output.js
336301
chunk {0} output.js (main) 325 bytes [entry] [rendered]
337-
> .\example.js main
302+
> ./example.js main
338303
[0] ./example.js + 6 modules 325 bytes {0} [built]
339304
[no exports]
340-
single entry .\example.js main
305+
single entry ./example.js main
341306
| ./example.js 140 bytes [built]
342307
| [no exports]
343-
| single entry .\example.js main
308+
| single entry ./example.js main
344309
| + 6 hidden modules
345310
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
optimization: {
3+
sideEffects: true
4+
}
5+
};

0 commit comments

Comments
 (0)