Skip to content

Commit

Permalink
chore: more tree shaking test2 (#4208)
Browse files Browse the repository at this point in the history
* chore: πŸ€– add export all star

* chore: πŸ€– snapshot

* chore: πŸ€– update snapshot

* chore: πŸ€– update snap

* chore: πŸ€– lint

* chore: πŸ€– lint

* chore: πŸ€– temp use wrong star list
  • Loading branch information
IWANABETHATGUY authored Sep 18, 2023
1 parent 54d8d61 commit e4eeb65
Show file tree
Hide file tree
Showing 30 changed files with 107 additions and 150 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ __webpack_require__.d(__webpack_exports__, {
"./c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'ccc': function() { return ccc; }
});
const ccc = 30;
},
"./index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
Expand Down
10 changes: 0 additions & 10 deletions crates/rspack/tests/tree-shaking/bb/snapshot/snap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,3 @@
/* harmony import */var _b_js__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./b.js */"./b.js");
/* harmony import */var _c_js__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./c.js */"./c.js");
__webpack_require__.es(_c_js__WEBPACK_IMPORTED_MODULE_1_, __webpack_exports__);
@@ -27,9 +30,6 @@
"./c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
- 'ccc': function() { return ccc; }
-});
const ccc = 30;
},
"./index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ __webpack_require__(/* ./answer */"./answer.js");
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'myanswer': function() { return myanswer; }
});
const myanswer = 'anyser';
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,3 @@

const answer = 42;
},
@@ -32,9 +53,6 @@
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
- 'myanswer': function() { return myanswer; }
-});
const myanswer = 'anyser';
},

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ _containers__WEBPACK_IMPORTED_MODULE_0_.usePlatform;
"./src/containers/platform-container/index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'usePlatform': function() { return usePlatform; }
});
const usePlatform = 3;
const PlatformProvider = 1000;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


},
@@ -36,13 +38,16 @@
@@ -36,12 +38,18 @@


},
Expand All @@ -23,10 +23,10 @@
"./src/containers/platform-container/index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
__webpack_require__.d(__webpack_exports__, {
- 'usePlatform': function() { return usePlatform; },
- 'PlatformProvider': function() { return PlatformProvider; }
-});
+ 'usePlatform': function() { return usePlatform; }
});
const usePlatform = 3;
const PlatformProvider = 1000;
},
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ __webpack_require__.r(__webpack_exports__);
"./baz.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
});
const a = 'baz';
},
"./foo.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ __webpack_require__.r(__webpack_exports__);
"./bar.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'c': function() { return c; }
});
const a = 'bar';
const c = 'bar';
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- expected
+++ actual
@@ -6,9 +6,6 @@
@@ -6,14 +6,14 @@
"./a.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
Expand All @@ -10,7 +10,15 @@
const c = 'a';
},
"./bar.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -34,9 +31,6 @@
'use strict';
__webpack_require__.r(__webpack_exports__);
+__webpack_require__.d(__webpack_exports__, {
+ 'c': function() { return c; }
+});
const a = 'bar';
const c = 'bar';
},
@@ -34,9 +34,6 @@
"./foo.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ __webpack_require__.d(__webpack_exports__, {
"./c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'cccc': function() { return cccc; }
});
function cccc() {}
},
"./export.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var __WEBPACK_DEFAULT_EXPORT__ = 2000 + _c_js__WEBPACK_IMPORTED_MODULE_0_["defau
"./c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
});
var __WEBPACK_DEFAULT_EXPORT__ = 10;
},
"./index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,3 @@
/* harmony import */var _c_js__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./c.js */"./c.js");

var __WEBPACK_DEFAULT_EXPORT__ = 2000 + _c_js__WEBPACK_IMPORTED_MODULE_0_["default"];
@@ -26,9 +25,6 @@
"./c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
- 'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
-});
var __WEBPACK_DEFAULT_EXPORT__ = 10;
},
"./index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ __webpack_require__.r(__webpack_exports__);
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@


},
@@ -23,14 +25,18 @@
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -24,13 +26,20 @@
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
__webpack_require__.d(__webpack_exports__, {
- 'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
-});
+ 'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ __webpack_require__.r(__webpack_exports__);
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
});
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./lib */"./lib.js");
/* harmony import */var _src_a__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./src/a */"./src/a.js");
@@ -24,9 +25,6 @@
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -25,7 +26,7 @@
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
__webpack_require__.d(__webpack_exports__, {
- 'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
-});
+ 'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ __webpack_require__.r(__webpack_exports__);
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@

// export {
// result as test
@@ -23,13 +32,50 @@
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
- 'something': function() { return something; }
-});
const secret = "888";
@@ -30,6 +39,46 @@
const result = 20000;
const something = function() {};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ __webpack_require__.r(__webpack_exports__);
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

// export {
// result as test
@@ -25,14 +27,18 @@
"./lib.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -26,13 +28,20 @@
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
__webpack_require__.d(__webpack_exports__, {
- 'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
-});
+ 'something': function() { return something; }
});
const secret = "888";
const result = 20000;
const something = function() {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ source: crates/rspack_testing/src/run_fixture.rs
"../node_modules/pmodule/a.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
});
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
var a = "a";
var b = "b";
Expand All @@ -18,7 +21,8 @@ var c = "c";
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'z': function() { return _c__WEBPACK_IMPORTED_MODULE_0_.z; }
'z': function() { return _c__WEBPACK_IMPORTED_MODULE_0_.z; },
'x': function() { return x; }
});
/* harmony import */var _c__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./c */"../node_modules/pmodule/c.js");
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
Expand All @@ -32,6 +36,9 @@ var y = "y";
"../node_modules/pmodule/c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'z': function() { return z; }
});
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
var z = "z";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
--- expected
+++ actual
@@ -6,9 +6,6 @@
"../node_modules/pmodule/a.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
- 'a': function() { return a; }
-});
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
var a = "a";
var b = "b";
@@ -21,8 +18,7 @@
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
- 'z': function() { return _c__WEBPACK_IMPORTED_MODULE_0_.z; },
- 'x': function() { return x; }
+ 'z': function() { return _c__WEBPACK_IMPORTED_MODULE_0_.z; }
});
/* harmony import */var _c__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./c */"../node_modules/pmodule/c.js");
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
@@ -36,9 +32,6 @@
"../node_modules/pmodule/c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
-__webpack_require__.d(__webpack_exports__, {
- 'z': function() { return z; }
-});
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
var z = "z";

@@ -50,6 +43,7 @@
@@ -50,6 +50,7 @@
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'x': function() { return _b__WEBPACK_IMPORTED_MODULE_1_.x; },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ var c = "c";
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'z': function() { return _c__WEBPACK_IMPORTED_MODULE_0_.z; }
'z': function() { return _c__WEBPACK_IMPORTED_MODULE_0_.z; },
'x': function() { return x; }
});
/* harmony import */var _c__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./c */"../node_modules/pmodule/c.js");
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
Expand All @@ -32,6 +33,9 @@ var y = "y";
"../node_modules/pmodule/c.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'z': function() { return z; }
});
/* harmony import */var _tracker__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./tracker */"../node_modules/pmodule/tracker.js");
var z = "z";
Expand Down
Loading

0 comments on commit e4eeb65

Please sign in to comment.