Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: import/export with string literal #4430

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
a: function() { return a; }
});
const a = 'a';
},
Expand All @@ -21,7 +21,7 @@ __webpack_require__.d(__webpack_exports__, {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'b': function() { return b; }
b: function() { return b; }
});
const b = "b";
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
a: function() { return a; }
});
const a = 3;
},
Expand All @@ -26,7 +26,7 @@ console.log("hello, world");
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
a: function() { return a; }
});
const a = 3;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'app': function() { return app; }
app: function() { return app; }
});
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./lib */"./lib.js");

Expand All @@ -25,7 +25,7 @@ __webpack_require__.r(__webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'result': function() { return result; }
result: function() { return result; }
});
const secret = "888";
const result = 20000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'app': function() { return app; }
app: function() { return app; }
});
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./lib */"./lib.js");

Expand All @@ -25,7 +25,7 @@ __webpack_require__.r(__webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'result': function() { return result; }
result: function() { return result; }
});
const secret = "888";
const result = 20000;
Expand Down
4 changes: 2 additions & 2 deletions crates/rspack/tests/tree-shaking/basic/snapshot/output.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'answer': function() { return answer; }
answer: function() { return answer; }
});
const answer = 103330;
},
Expand Down Expand Up @@ -39,7 +39,7 @@ __webpack_require__.r(__webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'myanswer': function() { return myanswer; }
myanswer: function() { return myanswer; }
});
/* harmony import */var _answer__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./answer */"./answer.js");

Expand Down
4 changes: 2 additions & 2 deletions crates/rspack/tests/tree-shaking/bb/snapshot/output.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ _b_js__WEBPACK_IMPORTED_MODULE_0_.d;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'd': function() { return d; }
d: function() { return d; }
});
const d = 3;
const c = 100;
Expand All @@ -28,7 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'ccc': function() { return ccc; }
ccc: function() { return ccc; }
});
const ccc = 30;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports["default"] = _default;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'locales': function() { return locales; }
locales: function() { return locales; }
});
/* harmony import */var _locale_zh__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ../locale_zh */"./locale_zh.ts");

Expand All @@ -29,7 +29,7 @@ const locales = {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'test': function() { return test; }
test: function() { return test; }
});
/* harmony import */var _antd_index__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./antd/index */"./antd/index.ts");

Expand All @@ -40,7 +40,7 @@ _antd_index__WEBPACK_IMPORTED_MODULE_0_.locales.zh_CN;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
"default": function() { return __WEBPACK_DEFAULT_EXPORT__; }
});
/* harmony import */var _zh_locale__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./zh_locale */"./zh_locale.js");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'answer': function() { return answer; }
answer: function() { return answer; }
});

const answer = 42;
Expand All @@ -16,7 +16,7 @@ __webpack_require__.d(__webpack_exports__, {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'myanswer': function() { return _lib__WEBPACK_IMPORTED_MODULE_0_.myanswer; }
myanswer: function() { return _lib__WEBPACK_IMPORTED_MODULE_0_.myanswer; }
});
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./lib */"./lib.js");

Expand All @@ -33,7 +33,7 @@ __webpack_require__(/* ./answer */"./answer.js");
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'myanswer': function() { return myanswer; }
myanswer: function() { return myanswer; }
});
const myanswer = 'anyser';
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'v': function() { return v; }
v: function() { return v; }
});
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./lib */"./lib.js");

Expand All @@ -31,7 +31,7 @@ _app__WEBPACK_IMPORTED_MODULE_0_.v;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'value': function() { return value; }
value: function() { return value; }
});
class Lib {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'value': function() { return value; }
value: function() { return value; }
});
const value = "dynamic";
},
"./child/index.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'value': function() { return value; }
value: function() { return value; }
});
const value = "dynamic";
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'default': function() { return __WEBPACK_DEFAULT_EXPORT__; }
"default": function() { return __WEBPACK_DEFAULT_EXPORT__; }
});
/* harmony import */var _containers__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./containers */"./src/containers/index.js");

Expand All @@ -30,7 +30,7 @@ __webpack_require__.es(_platform_container__WEBPACK_IMPORTED_MODULE_0_, __webpac
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'containers': function() { return _containers__WEBPACK_IMPORTED_MODULE_0_; }
containers: function() { return _containers__WEBPACK_IMPORTED_MODULE_0_; }
});
/* harmony import */var _containers__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./containers */"./src/containers/containers.js");

Expand All @@ -40,8 +40,8 @@ __webpack_require__.d(__webpack_exports__, {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'usePlatform': function() { return usePlatform; },
'PlatformProvider': function() { return PlatformProvider; }
usePlatform: function() { return usePlatform; },
PlatformProvider: function() { return PlatformProvider; }
});
const usePlatform = 3;
const PlatformProvider = 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'answer': function() { return answer; }
answer: function() { return answer; }
});
const answer = 103330; // export default answer;
},
"./app.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'render': function() { return render; },
'default': function() { return result; }
render: function() { return render; },
"default": function() { return result; }
});
/* harmony import */var _lib__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./lib */"./lib.js");

Expand All @@ -39,8 +39,8 @@ __webpack_require__.r(__webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'secret': function() { return secret; },
'myanswer': function() { return myanswer; }
secret: function() { return secret; },
myanswer: function() { return myanswer; }
});
/* harmony import */var _answer__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./answer */"./answer.js");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ __webpack_require__.r(__webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
a: function() { return a; }
});
/* harmony import */var _bar__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./bar */"./bar.js");
__webpack_require__.es(_bar__WEBPACK_IMPORTED_MODULE_0_, __webpack_exports__);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ __webpack_require__.r(__webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
a: function() { return a; }
});
const a = 'baz';
},
"./foo.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return _baz__WEBPACK_IMPORTED_MODULE_0_.a; }
a: function() { return _baz__WEBPACK_IMPORTED_MODULE_0_.a; }
});
/* harmony import */var _baz__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./baz */"./baz.js");
/* harmony import */var _bar__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./bar */"./bar.js");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _answer__WEBPACK_IMPORTED_MODULE_0_.filter;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'filter': function() { return _test_js__WEBPACK_IMPORTED_MODULE_0_; }
filter: function() { return _test_js__WEBPACK_IMPORTED_MODULE_0_; }
});
/* harmony import */var _test_js__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./test.js */"./test.js");
const a = 3;
Expand All @@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'result': function() { return result; }
result: function() { return result; }
});
const result = "";
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'formatNumber': function() { return _plugin_formatNumber__WEBPACK_IMPORTED_MODULE_0_["default"]; }
formatNumber: function() { return _plugin_formatNumber__WEBPACK_IMPORTED_MODULE_0_["default"]; }
});
/* harmony import */var _plugin_formatNumber__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./plugin/formatNumber */"./src/plugin/formatNumber.js");

Expand All @@ -24,7 +24,7 @@ console.log(_answer__WEBPACK_IMPORTED_MODULE_0_);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'default': function() { return formatNumber_default; }
"default": function() { return formatNumber_default; }
});
function formatNumber(config) {}
const plugin = (cls)=>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ __webpack_require__.es(_something__WEBPACK_IMPORTED_MODULE_0_, __webpack_exports
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'red': function() { return red; }
red: function() { return red; }
});
const red = 'red';
},
"./colors/b.js": function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'blue': function() { return blue; }
blue: function() { return blue; }
});
const blue = 'blue';
},
Expand Down Expand Up @@ -51,7 +51,7 @@ __webpack_require__.es(_c__WEBPACK_IMPORTED_MODULE_2_, __webpack_exports__);
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'result': function() { return result; }
result: function() { return result; }
});
const result = 'ssss';
},
Expand All @@ -74,7 +74,7 @@ _export__WEBPACK_IMPORTED_MODULE_0_.Something;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'Something': function() { return Something; }
Something: function() { return Something; }
});
class Something {
}
Expand All @@ -83,7 +83,7 @@ __webpack_require__.d(__webpack_exports__, {
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'Colors': function() { return _colors_index__WEBPACK_IMPORTED_MODULE_0_; }
Colors: function() { return _colors_index__WEBPACK_IMPORTED_MODULE_0_; }
});
/* harmony import */var _colors_index__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ../colors/index */"./colors/index.js");
/* harmony import */var _Something__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./Something */"./something/Something.js");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source: crates/rspack_testing/src/run_fixture.rs
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'bar': function() { return _foo__WEBPACK_IMPORTED_MODULE_0_; }
bar: function() { return _foo__WEBPACK_IMPORTED_MODULE_0_; }
});
/* harmony import */var _foo__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./foo */"./foo.js");
/* harmony import */var _result__WEBPACK_IMPORTED_MODULE_1_ = __webpack_require__(/* ./result */"./result.js");
Expand All @@ -20,7 +20,7 @@ __webpack_require__.es(_result__WEBPACK_IMPORTED_MODULE_1_, __webpack_exports__)
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'a': function() { return a; }
a: function() { return a; }
});
/* harmony import */var _bar__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./bar */"./bar.js");
__webpack_require__.es(_bar__WEBPACK_IMPORTED_MODULE_0_, __webpack_exports__);
Expand All @@ -43,7 +43,7 @@ _foo__WEBPACK_IMPORTED_MODULE_0_.bar.a;
'use strict';
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
'c': function() { return c; }
c: function() { return c; }
});
/* harmony import */var _foo__WEBPACK_IMPORTED_MODULE_0_ = __webpack_require__(/* ./foo */"./foo.js");
__webpack_require__.es(_foo__WEBPACK_IMPORTED_MODULE_0_, __webpack_exports__);
Expand Down
Loading
Loading