@unpackjs/core 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/postcss-loader/index.js +58 -55
- package/dist/bundler-config/css.cjs +3 -4
- package/dist/bundler-config/css.js +5 -5
- package/dist/bundler-config/experimentCss.cjs +2 -3
- package/dist/bundler-config/experimentCss.js +3 -3
- package/dist/bundler-config/helper.cjs +4 -2
- package/dist/bundler-config/helper.d.ts.map +1 -1
- package/dist/bundler-config/helper.js +4 -2
- package/dist/bundler-config/index.cjs +18 -20
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +19 -29
- package/dist/config.cjs +14 -46
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +15 -47
- package/dist/createUnpack.cjs +103 -0
- package/dist/createUnpack.d.ts +7 -0
- package/dist/createUnpack.d.ts.map +1 -0
- package/dist/createUnpack.js +79 -0
- package/dist/index.cjs +5 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/plugin-progress/rspack.cjs +1 -1
- package/dist/plugin-progress/rspack.js +1 -1
- package/dist/plugin-progress/webpack.cjs +1 -1
- package/dist/plugin-progress/webpack.js +1 -1
- package/dist/reporter.cjs +2 -2
- package/dist/reporter.d.ts +2 -1
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +2 -2
- package/dist/run/dev.cjs +1 -1
- package/dist/run/dev.js +1 -1
- package/dist/thread-loader/worker.js +1 -1
- package/dist/utils.cjs +26 -24
- package/dist/utils.d.ts +7 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +23 -22
- package/package.json +2 -2
- package/dist/createService.cjs +0 -65
- package/dist/createService.d.ts +0 -8
- package/dist/createService.d.ts.map +0 -1
- package/dist/createService.js +0 -41
|
@@ -93151,7 +93151,7 @@
|
|
|
93151
93151
|
const errorEx = __nccwpck_require__(7861);
|
|
93152
93152
|
const fallback = __nccwpck_require__(3984);
|
|
93153
93153
|
const { default: LinesAndColumns } = __nccwpck_require__(7151);
|
|
93154
|
-
const { codeFrameColumns } = __nccwpck_require__(
|
|
93154
|
+
const { codeFrameColumns } = __nccwpck_require__(5780);
|
|
93155
93155
|
const JSONError = errorEx("JSONError", {
|
|
93156
93156
|
fileName: errorEx.append("in %s"),
|
|
93157
93157
|
codeFrame: errorEx.append("\n\n%s\n"),
|
|
@@ -94204,12 +94204,12 @@
|
|
|
94204
94204
|
"use strict";
|
|
94205
94205
|
module.exports = require("vm");
|
|
94206
94206
|
},
|
|
94207
|
-
|
|
94207
|
+
5780: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
94208
94208
|
"use strict";
|
|
94209
94209
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94210
94210
|
exports.codeFrameColumns = codeFrameColumns;
|
|
94211
94211
|
exports["default"] = _default;
|
|
94212
|
-
var _highlight = __nccwpck_require__(
|
|
94212
|
+
var _highlight = __nccwpck_require__(3154);
|
|
94213
94213
|
var _picocolors = _interopRequireWildcard(
|
|
94214
94214
|
__nccwpck_require__(5209),
|
|
94215
94215
|
true,
|
|
@@ -94231,7 +94231,7 @@
|
|
|
94231
94231
|
var n = { __proto__: null },
|
|
94232
94232
|
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
94233
94233
|
for (var u in e)
|
|
94234
|
-
if ("default" !== u &&
|
|
94234
|
+
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
94235
94235
|
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
94236
94236
|
i && (i.get || i.set)
|
|
94237
94237
|
? Object.defineProperty(n, u, i)
|
|
@@ -94395,16 +94395,16 @@
|
|
|
94395
94395
|
return codeFrameColumns(rawLines, location, opts);
|
|
94396
94396
|
}
|
|
94397
94397
|
},
|
|
94398
|
-
|
|
94398
|
+
3287: (__unused_webpack_module, exports) => {
|
|
94399
94399
|
"use strict";
|
|
94400
94400
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94401
94401
|
exports.isIdentifierChar = isIdentifierChar;
|
|
94402
94402
|
exports.isIdentifierName = isIdentifierName;
|
|
94403
94403
|
exports.isIdentifierStart = isIdentifierStart;
|
|
94404
94404
|
let nonASCIIidentifierStartChars =
|
|
94405
|
-
"
|
|
94405
|
+
"ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
94406
94406
|
let nonASCIIidentifierChars =
|
|
94407
|
-
"
|
|
94407
|
+
"·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
94408
94408
|
const nonASCIIidentifierStart = new RegExp(
|
|
94409
94409
|
"[" + nonASCIIidentifierStartChars + "]",
|
|
94410
94410
|
);
|
|
@@ -94416,49 +94416,52 @@
|
|
|
94416
94416
|
0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4,
|
|
94417
94417
|
48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35,
|
|
94418
94418
|
5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2,
|
|
94419
|
-
1,
|
|
94420
|
-
4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71,
|
|
94421
|
-
65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28,
|
|
94422
|
-
11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35,
|
|
94423
|
-
|
|
94424
|
-
|
|
94425
|
-
|
|
94426
|
-
|
|
94427
|
-
|
|
94428
|
-
|
|
94429
|
-
|
|
94430
|
-
|
|
94431
|
-
|
|
94432
|
-
|
|
94433
|
-
|
|
94434
|
-
|
|
94435
|
-
|
|
94436
|
-
|
|
94437
|
-
|
|
94438
|
-
|
|
94439
|
-
|
|
94440
|
-
|
|
94441
|
-
|
|
94442
|
-
|
|
94443
|
-
2,
|
|
94444
|
-
|
|
94419
|
+
1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2,
|
|
94420
|
+
43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71,
|
|
94421
|
+
55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28,
|
|
94422
|
+
53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10,
|
|
94423
|
+
22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22,
|
|
94424
|
+
13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0,
|
|
94425
|
+
13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2,
|
|
94426
|
+
14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13,
|
|
94427
|
+
4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2,
|
|
94428
|
+
31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72,
|
|
94429
|
+
26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2,
|
|
94430
|
+
0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0,
|
|
94431
|
+
19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22,
|
|
94432
|
+
0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80,
|
|
94433
|
+
921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582,
|
|
94434
|
+
6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6,
|
|
94435
|
+
18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9,
|
|
94436
|
+
1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9,
|
|
94437
|
+
395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3,
|
|
94438
|
+
3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0,
|
|
94439
|
+
4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2,
|
|
94440
|
+
30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322,
|
|
94441
|
+
29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196,
|
|
94442
|
+
60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0,
|
|
94443
|
+
7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0,
|
|
94444
|
+
2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2,
|
|
94445
|
+
16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467,
|
|
94446
|
+
541, 1507, 4938, 6, 4191,
|
|
94445
94447
|
];
|
|
94446
94448
|
const astralIdentifierCodes = [
|
|
94447
94449
|
509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166,
|
|
94448
|
-
1, 574, 3, 9, 9,
|
|
94449
|
-
3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1,
|
|
94450
|
-
2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7,
|
|
94451
|
-
2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4,
|
|
94452
|
-
|
|
94453
|
-
|
|
94454
|
-
|
|
94455
|
-
|
|
94456
|
-
|
|
94457
|
-
|
|
94458
|
-
|
|
94459
|
-
|
|
94460
|
-
|
|
94461
|
-
|
|
94450
|
+
1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54,
|
|
94451
|
+
14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1,
|
|
94452
|
+
45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7,
|
|
94453
|
+
3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0,
|
|
94454
|
+
2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3,
|
|
94455
|
+
8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14,
|
|
94456
|
+
166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9,
|
|
94457
|
+
41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21,
|
|
94458
|
+
2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9,
|
|
94459
|
+
330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27,
|
|
94460
|
+
2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0,
|
|
94461
|
+
12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31,
|
|
94462
|
+
3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6,
|
|
94463
|
+
2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13,
|
|
94464
|
+
245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239,
|
|
94462
94465
|
];
|
|
94463
94466
|
function isInAstralSet(code, set) {
|
|
94464
94467
|
let pos = 65536;
|
|
@@ -94522,7 +94525,7 @@
|
|
|
94522
94525
|
return !isFirst;
|
|
94523
94526
|
}
|
|
94524
94527
|
},
|
|
94525
|
-
|
|
94528
|
+
6877: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
94526
94529
|
"use strict";
|
|
94527
94530
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94528
94531
|
Object.defineProperty(exports, "isIdentifierChar", {
|
|
@@ -94573,10 +94576,10 @@
|
|
|
94573
94576
|
return _keyword.isStrictReservedWord;
|
|
94574
94577
|
},
|
|
94575
94578
|
});
|
|
94576
|
-
var _identifier = __nccwpck_require__(
|
|
94577
|
-
var _keyword = __nccwpck_require__(
|
|
94579
|
+
var _identifier = __nccwpck_require__(3287);
|
|
94580
|
+
var _keyword = __nccwpck_require__(7058);
|
|
94578
94581
|
},
|
|
94579
|
-
|
|
94582
|
+
7058: (__unused_webpack_module, exports) => {
|
|
94580
94583
|
"use strict";
|
|
94581
94584
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94582
94585
|
exports.isKeyword = isKeyword;
|
|
@@ -94659,13 +94662,13 @@
|
|
|
94659
94662
|
return keywords.has(word);
|
|
94660
94663
|
}
|
|
94661
94664
|
},
|
|
94662
|
-
|
|
94665
|
+
3154: (__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
94663
94666
|
"use strict";
|
|
94664
94667
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94665
94668
|
exports["default"] = highlight;
|
|
94666
94669
|
exports.shouldHighlight = shouldHighlight;
|
|
94667
94670
|
var _jsTokens = __nccwpck_require__(1192);
|
|
94668
|
-
var _helperValidatorIdentifier = __nccwpck_require__(
|
|
94671
|
+
var _helperValidatorIdentifier = __nccwpck_require__(6877);
|
|
94669
94672
|
var _picocolors = _interopRequireWildcard(
|
|
94670
94673
|
__nccwpck_require__(5209),
|
|
94671
94674
|
true,
|
|
@@ -94687,7 +94690,7 @@
|
|
|
94687
94690
|
var n = { __proto__: null },
|
|
94688
94691
|
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
94689
94692
|
for (var u in e)
|
|
94690
|
-
if ("default" !== u &&
|
|
94693
|
+
if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
94691
94694
|
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
94692
94695
|
i && (i.get || i.set)
|
|
94693
94696
|
? Object.defineProperty(n, u, i)
|
|
@@ -94742,7 +94745,7 @@
|
|
|
94742
94745
|
if (
|
|
94743
94746
|
JSX_TAG.test(token.value) &&
|
|
94744
94747
|
(text[offset - 1] === "<" ||
|
|
94745
|
-
text.slice(offset - 2, offset)
|
|
94748
|
+
text.slice(offset - 2, offset) === "</")
|
|
94746
94749
|
) {
|
|
94747
94750
|
return "jsxIdentifier";
|
|
94748
94751
|
}
|
|
@@ -36,12 +36,11 @@ var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"))
|
|
|
36
36
|
var import_constants = require("../constants.cjs");
|
|
37
37
|
var import_utils = require("../utils.cjs");
|
|
38
38
|
var import_helper = require("./helper.cjs");
|
|
39
|
-
const { merge } = require("../../compiled/webpack-merge/index.js");
|
|
40
39
|
function addCssSupport({
|
|
41
40
|
config,
|
|
42
41
|
unpackConfig
|
|
43
42
|
}) {
|
|
44
|
-
const MiniCssExtractPlugin = unpackConfig.bundler === "
|
|
43
|
+
const MiniCssExtractPlugin = unpackConfig.bundler === "rspack" ? import_core.rspack.CssExtractRspackPlugin : import_mini_css_extract_plugin.default;
|
|
45
44
|
let modules = unpackConfig.css?.modules;
|
|
46
45
|
if (!(0, import_utils.isPlainObject)(modules) && modules !== false)
|
|
47
46
|
modules = {};
|
|
@@ -109,7 +108,7 @@ function addCssSupport({
|
|
|
109
108
|
{
|
|
110
109
|
loader: (0, import_utils.getCompiledPkgPath)("less-loader"),
|
|
111
110
|
options: {
|
|
112
|
-
lessOptions:
|
|
111
|
+
lessOptions: (0, import_utils.mergeConfig)(
|
|
113
112
|
{
|
|
114
113
|
javascriptEnabled: true
|
|
115
114
|
},
|
|
@@ -124,7 +123,7 @@ function addCssSupport({
|
|
|
124
123
|
const getLightningcssLoader = () => {
|
|
125
124
|
return {
|
|
126
125
|
loader: import_node_path.default.resolve(__dirname, "../lightningcss/loader.cjs"),
|
|
127
|
-
options:
|
|
126
|
+
options: (0, import_utils.mergeConfig)(unpackConfig.css?.lightningcss || {}, {
|
|
128
127
|
sourceMap: unpackConfig.css?.sourceMap
|
|
129
128
|
})
|
|
130
129
|
};
|
|
@@ -24,15 +24,15 @@ import {
|
|
|
24
24
|
isDevServer,
|
|
25
25
|
isFunction,
|
|
26
26
|
isPlainObject,
|
|
27
|
-
isRegExp
|
|
27
|
+
isRegExp,
|
|
28
|
+
mergeConfig
|
|
28
29
|
} from "../utils.js";
|
|
29
30
|
import { getOutputFilename } from "./helper.js";
|
|
30
|
-
const { merge } = require("../../compiled/webpack-merge/index.js");
|
|
31
31
|
function addCssSupport({
|
|
32
32
|
config,
|
|
33
33
|
unpackConfig
|
|
34
34
|
}) {
|
|
35
|
-
const MiniCssExtractPlugin = unpackConfig.bundler === "
|
|
35
|
+
const MiniCssExtractPlugin = unpackConfig.bundler === "rspack" ? rspack.CssExtractRspackPlugin : WebpackMiniCssExtractPlugin;
|
|
36
36
|
let modules = unpackConfig.css?.modules;
|
|
37
37
|
if (!isPlainObject(modules) && modules !== false)
|
|
38
38
|
modules = {};
|
|
@@ -100,7 +100,7 @@ function addCssSupport({
|
|
|
100
100
|
{
|
|
101
101
|
loader: getCompiledPkgPath("less-loader"),
|
|
102
102
|
options: {
|
|
103
|
-
lessOptions:
|
|
103
|
+
lessOptions: mergeConfig(
|
|
104
104
|
{
|
|
105
105
|
javascriptEnabled: true
|
|
106
106
|
},
|
|
@@ -115,7 +115,7 @@ function addCssSupport({
|
|
|
115
115
|
const getLightningcssLoader = () => {
|
|
116
116
|
return {
|
|
117
117
|
loader: path2.resolve(__dirname, "../lightningcss/loader.cjs"),
|
|
118
|
-
options:
|
|
118
|
+
options: mergeConfig(unpackConfig.css?.lightningcss || {}, {
|
|
119
119
|
sourceMap: unpackConfig.css?.sourceMap
|
|
120
120
|
})
|
|
121
121
|
};
|
|
@@ -35,7 +35,6 @@ var import_constants = require("../constants.cjs");
|
|
|
35
35
|
var import_typed_css_modules = require("../typed-css-modules/index.cjs");
|
|
36
36
|
var import_utils = require("../utils.cjs");
|
|
37
37
|
var import_helper = require("./helper.cjs");
|
|
38
|
-
const { merge } = require("../../compiled/webpack-merge/index.js");
|
|
39
38
|
function addExperimentCssSupport({
|
|
40
39
|
config,
|
|
41
40
|
unpackConfig
|
|
@@ -86,7 +85,7 @@ function addExperimentCssSupport({
|
|
|
86
85
|
return {
|
|
87
86
|
loader: (0, import_utils.getCompiledPkgPath)("less-loader"),
|
|
88
87
|
options: {
|
|
89
|
-
lessOptions:
|
|
88
|
+
lessOptions: (0, import_utils.mergeConfig)(
|
|
90
89
|
{
|
|
91
90
|
javascriptEnabled: true
|
|
92
91
|
},
|
|
@@ -110,7 +109,7 @@ function addExperimentCssSupport({
|
|
|
110
109
|
const getLightningcssLoader = () => {
|
|
111
110
|
return {
|
|
112
111
|
loader: import_node_path.default.resolve(__dirname, "../lightningcss/loader.cjs"),
|
|
113
|
-
options:
|
|
112
|
+
options: (0, import_utils.mergeConfig)(unpackConfig.css?.lightningcss || {}, {
|
|
114
113
|
sourceMap: unpackConfig.css?.sourceMap
|
|
115
114
|
})
|
|
116
115
|
};
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
isFunction,
|
|
24
24
|
isPlainObject,
|
|
25
25
|
isRegExp,
|
|
26
|
+
mergeConfig,
|
|
26
27
|
setValueByPath
|
|
27
28
|
} from "../utils.js";
|
|
28
29
|
import { getOutputFilename } from "./helper.js";
|
|
29
|
-
const { merge } = require("../../compiled/webpack-merge/index.js");
|
|
30
30
|
function addExperimentCssSupport({
|
|
31
31
|
config,
|
|
32
32
|
unpackConfig
|
|
@@ -77,7 +77,7 @@ function addExperimentCssSupport({
|
|
|
77
77
|
return {
|
|
78
78
|
loader: getCompiledPkgPath("less-loader"),
|
|
79
79
|
options: {
|
|
80
|
-
lessOptions:
|
|
80
|
+
lessOptions: mergeConfig(
|
|
81
81
|
{
|
|
82
82
|
javascriptEnabled: true
|
|
83
83
|
},
|
|
@@ -101,7 +101,7 @@ function addExperimentCssSupport({
|
|
|
101
101
|
const getLightningcssLoader = () => {
|
|
102
102
|
return {
|
|
103
103
|
loader: path2.resolve(__dirname, "../lightningcss/loader.cjs"),
|
|
104
|
-
options:
|
|
104
|
+
options: mergeConfig(unpackConfig.css?.lightningcss || {}, {
|
|
105
105
|
sourceMap: unpackConfig.css?.sourceMap
|
|
106
106
|
})
|
|
107
107
|
};
|
|
@@ -38,13 +38,15 @@ var import_constants = require("../constants.cjs");
|
|
|
38
38
|
var import_logger = require("../logger.cjs");
|
|
39
39
|
const glob = require("../../compiled/fast-glob/index.js");
|
|
40
40
|
async function getEntry(root, customEntry) {
|
|
41
|
-
let entry =
|
|
42
|
-
if (!
|
|
41
|
+
let entry = void 0;
|
|
42
|
+
if (!customEntry) {
|
|
43
43
|
const files = await glob("(index|Index).{js,ts,jsx,tsx}", {
|
|
44
44
|
cwd: import_node_path.default.join(root, "src"),
|
|
45
45
|
absolute: true
|
|
46
46
|
});
|
|
47
47
|
entry = files[0];
|
|
48
|
+
} else {
|
|
49
|
+
entry = import_node_path.default.resolve(root, customEntry);
|
|
48
50
|
}
|
|
49
51
|
if (!import_node_fs.default.existsSync(entry)) {
|
|
50
52
|
import_logger.logger.error(new Error("Could not find entry file"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/bundler-config/helper.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/bundler-config/helper.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBjF;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AACD,eAAO,MAAM,iBAAiB,mBAAoB,cAAc,WAqB/D,CAAA"}
|
|
@@ -14,13 +14,15 @@ import { isDev } from "../utils.js";
|
|
|
14
14
|
import { DEV_DEFAULT_FILENAME, PROD_DEFAULT_FILENAME } from "../constants.js";
|
|
15
15
|
import { logger } from "../logger.js";
|
|
16
16
|
async function getEntry(root, customEntry) {
|
|
17
|
-
let entry =
|
|
18
|
-
if (!
|
|
17
|
+
let entry = void 0;
|
|
18
|
+
if (!customEntry) {
|
|
19
19
|
const files = await glob("(index|Index).{js,ts,jsx,tsx}", {
|
|
20
20
|
cwd: path2.join(root, "src"),
|
|
21
21
|
absolute: true
|
|
22
22
|
});
|
|
23
23
|
entry = files[0];
|
|
24
|
+
} else {
|
|
25
|
+
entry = path2.resolve(root, customEntry);
|
|
24
26
|
}
|
|
25
27
|
if (!fs.existsSync(entry)) {
|
|
26
28
|
logger.error(new Error("Could not find entry file"));
|
|
@@ -52,28 +52,26 @@ var import_helper = require("./helper.cjs");
|
|
|
52
52
|
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
|
53
53
|
const BundleAnalyzerPlugin = require("../../compiled/webpack-bundle-analyzer/index.js").BundleAnalyzerPlugin;
|
|
54
54
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
55
|
-
const { merge } = require("../../compiled/webpack-merge/index.js");
|
|
56
55
|
async function getBundlerConfig(unpackConfig) {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
return new import_core.rspack.DefinePlugin(define);
|
|
60
|
-
}
|
|
61
|
-
return new import_esbuild_loader.EsbuildPlugin({ define, implementation: import_esbuild.default });
|
|
62
|
-
};
|
|
56
|
+
const isRspack = unpackConfig.bundler === "rspack";
|
|
57
|
+
const definePlugin = (define) => isRspack ? new import_core.rspack.DefinePlugin(define) : new import_esbuild_loader.EsbuildPlugin({ define, implementation: import_esbuild.default });
|
|
63
58
|
const JS_FILENAME = (0, import_helper.getOutputFilename)({ type: "js", hash: unpackConfig.build?.filenameHash });
|
|
64
|
-
const IgnorePlugin =
|
|
65
|
-
const CopyPlugin =
|
|
59
|
+
const IgnorePlugin = isRspack ? import_core.rspack.IgnorePlugin : import_webpack2.default.IgnorePlugin;
|
|
60
|
+
const CopyPlugin = isRspack ? import_core.rspack.CopyRspackPlugin : CopyWebpackPlugin;
|
|
61
|
+
const tsconfigPath = import_node_path.default.resolve(unpackConfig.root, "tsconfig.json");
|
|
62
|
+
const isTs = import_node_fs.default.existsSync(tsconfigPath);
|
|
66
63
|
const getAliasFromTsconfig = () => {
|
|
67
|
-
const paths = import_json5.default.parse(
|
|
68
|
-
import_node_fs.default.readFileSync(import_node_path.default.resolve(unpackConfig.root, "tsconfig.json"), "utf-8")
|
|
69
|
-
)?.compilerOptions?.paths;
|
|
64
|
+
const paths = import_json5.default.parse(import_node_fs.default.readFileSync(tsconfigPath, "utf-8"))?.compilerOptions?.paths;
|
|
70
65
|
return paths ? Object.keys(paths).reduce((acc, key) => {
|
|
71
|
-
acc[key.replace(/\/\*$/, "")] =
|
|
66
|
+
acc[key.replace(/\/\*$/, "")] = import_node_path.default.resolve(
|
|
67
|
+
unpackConfig.root,
|
|
68
|
+
paths[key][0].replace(/\/\*$/, "")
|
|
69
|
+
);
|
|
72
70
|
return acc;
|
|
73
71
|
}, {}) : {};
|
|
74
72
|
};
|
|
75
73
|
const minifyOptions = (0, import_utils.isPlainObject)(unpackConfig.build?.minify) ? unpackConfig.build?.minify : {};
|
|
76
|
-
const PluginProgress =
|
|
74
|
+
const PluginProgress = isRspack ? import_rspack.RspackPluginProgress : import_webpack.WebpackPluginProgress;
|
|
77
75
|
let config = {
|
|
78
76
|
context: unpackConfig.root,
|
|
79
77
|
mode: (0, import_utils.isDev)() ? "development" : "production",
|
|
@@ -126,14 +124,14 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
126
124
|
contextRegExp: /moment$/
|
|
127
125
|
}),
|
|
128
126
|
unpackConfig.build?.copy && new CopyPlugin({ patterns: unpackConfig.build.copy }),
|
|
129
|
-
(0, import_utils.isDev)() &&
|
|
127
|
+
(0, import_utils.isDev)() && isTs && new ForkTsCheckerWebpackPlugin({
|
|
130
128
|
typescript: {
|
|
131
129
|
// set 'readonly' to avoid emitting tsbuildinfo, as the generated tsbuildinfo will break fork-ts-checker
|
|
132
130
|
mode: "readonly",
|
|
133
131
|
// avoid OOM issue
|
|
134
132
|
memoryLimit: 8192,
|
|
135
133
|
// use tsconfig of user project
|
|
136
|
-
configFile:
|
|
134
|
+
configFile: tsconfigPath,
|
|
137
135
|
// use typescript of user project
|
|
138
136
|
typescriptPath: require.resolve("typescript", {
|
|
139
137
|
paths: [unpackConfig.root]
|
|
@@ -156,7 +154,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
156
154
|
resolve: {
|
|
157
155
|
alias: {
|
|
158
156
|
"@": import_node_path.default.resolve(unpackConfig.root, "src"),
|
|
159
|
-
...
|
|
157
|
+
...isTs ? getAliasFromTsconfig() : {},
|
|
160
158
|
...unpackConfig.resolve?.alias
|
|
161
159
|
},
|
|
162
160
|
extensions: [".tsx", ".ts", ".jsx", ".js", ...unpackConfig.resolve?.extensions || []]
|
|
@@ -184,7 +182,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
184
182
|
for (const plugin of (0, import_plugin.getNormalizedPluginsByHook)("bundlerConfig", unpackConfig.plugins)) {
|
|
185
183
|
config = await plugin.bundlerConfig(config, {
|
|
186
184
|
unpackConfig,
|
|
187
|
-
mergeConfig:
|
|
185
|
+
mergeConfig: import_utils.mergeConfig,
|
|
188
186
|
bundler: import_webpack2.default
|
|
189
187
|
});
|
|
190
188
|
}
|
|
@@ -192,10 +190,10 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
192
190
|
if ((0, import_utils.isFunction)(unpackConfig.bundlerConfig)) {
|
|
193
191
|
config = await unpackConfig.bundlerConfig(config, {
|
|
194
192
|
bundler: unpackConfig.bundler,
|
|
195
|
-
mergeConfig:
|
|
193
|
+
mergeConfig: import_utils.mergeConfig
|
|
196
194
|
});
|
|
197
195
|
} else {
|
|
198
|
-
config =
|
|
196
|
+
config = (0, import_utils.mergeConfig)(config, unpackConfig.bundlerConfig);
|
|
199
197
|
}
|
|
200
198
|
}
|
|
201
199
|
return config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAqBzE,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAmKhG"}
|
|
@@ -11,15 +11,7 @@ import fs from "node:fs";
|
|
|
11
11
|
import path2 from "node:path";
|
|
12
12
|
import { rspack } from "@rspack/core";
|
|
13
13
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
14
|
-
import {
|
|
15
|
-
getValidPath,
|
|
16
|
-
isDev,
|
|
17
|
-
isDevServer,
|
|
18
|
-
isFunction,
|
|
19
|
-
isPlainObject,
|
|
20
|
-
isProd,
|
|
21
|
-
isTs
|
|
22
|
-
} from "../utils.js";
|
|
14
|
+
import { isDev, isDevServer, isFunction, isPlainObject, isProd, mergeConfig } from "../utils.js";
|
|
23
15
|
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
|
24
16
|
const BundleAnalyzerPlugin = require("../../compiled/webpack-bundle-analyzer/index.js").BundleAnalyzerPlugin;
|
|
25
17
|
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
|
@@ -37,28 +29,26 @@ import { addChunkSplitSupport } from "./chunkSplit.js";
|
|
|
37
29
|
import { addCssSupport } from "./css.js";
|
|
38
30
|
import { addExperimentCssSupport } from "./experimentCss.js";
|
|
39
31
|
import { getEntry, getOutputFilename } from "./helper.js";
|
|
40
|
-
const { merge } = require("../../compiled/webpack-merge/index.js");
|
|
41
32
|
async function getBundlerConfig(unpackConfig) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
return new rspack.DefinePlugin(define);
|
|
45
|
-
}
|
|
46
|
-
return new EsbuildPlugin({ define, implementation: esbuild });
|
|
47
|
-
};
|
|
33
|
+
const isRspack = unpackConfig.bundler === "rspack";
|
|
34
|
+
const definePlugin = (define) => isRspack ? new rspack.DefinePlugin(define) : new EsbuildPlugin({ define, implementation: esbuild });
|
|
48
35
|
const JS_FILENAME = getOutputFilename({ type: "js", hash: unpackConfig.build?.filenameHash });
|
|
49
|
-
const IgnorePlugin =
|
|
50
|
-
const CopyPlugin =
|
|
36
|
+
const IgnorePlugin = isRspack ? rspack.IgnorePlugin : webpack.IgnorePlugin;
|
|
37
|
+
const CopyPlugin = isRspack ? rspack.CopyRspackPlugin : CopyWebpackPlugin;
|
|
38
|
+
const tsconfigPath = path2.resolve(unpackConfig.root, "tsconfig.json");
|
|
39
|
+
const isTs = fs.existsSync(tsconfigPath);
|
|
51
40
|
const getAliasFromTsconfig = () => {
|
|
52
|
-
const paths = json5.parse(
|
|
53
|
-
fs.readFileSync(path2.resolve(unpackConfig.root, "tsconfig.json"), "utf-8")
|
|
54
|
-
)?.compilerOptions?.paths;
|
|
41
|
+
const paths = json5.parse(fs.readFileSync(tsconfigPath, "utf-8"))?.compilerOptions?.paths;
|
|
55
42
|
return paths ? Object.keys(paths).reduce((acc, key) => {
|
|
56
|
-
acc[key.replace(/\/\*$/, "")] =
|
|
43
|
+
acc[key.replace(/\/\*$/, "")] = path2.resolve(
|
|
44
|
+
unpackConfig.root,
|
|
45
|
+
paths[key][0].replace(/\/\*$/, "")
|
|
46
|
+
);
|
|
57
47
|
return acc;
|
|
58
48
|
}, {}) : {};
|
|
59
49
|
};
|
|
60
50
|
const minifyOptions = isPlainObject(unpackConfig.build?.minify) ? unpackConfig.build?.minify : {};
|
|
61
|
-
const PluginProgress =
|
|
51
|
+
const PluginProgress = isRspack ? RspackPluginProgress : WebpackPluginProgress;
|
|
62
52
|
let config = {
|
|
63
53
|
context: unpackConfig.root,
|
|
64
54
|
mode: isDev() ? "development" : "production",
|
|
@@ -111,14 +101,14 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
111
101
|
contextRegExp: /moment$/
|
|
112
102
|
}),
|
|
113
103
|
unpackConfig.build?.copy && new CopyPlugin({ patterns: unpackConfig.build.copy }),
|
|
114
|
-
isDev() && isTs
|
|
104
|
+
isDev() && isTs && new ForkTsCheckerWebpackPlugin({
|
|
115
105
|
typescript: {
|
|
116
106
|
// set 'readonly' to avoid emitting tsbuildinfo, as the generated tsbuildinfo will break fork-ts-checker
|
|
117
107
|
mode: "readonly",
|
|
118
108
|
// avoid OOM issue
|
|
119
109
|
memoryLimit: 8192,
|
|
120
110
|
// use tsconfig of user project
|
|
121
|
-
configFile:
|
|
111
|
+
configFile: tsconfigPath,
|
|
122
112
|
// use typescript of user project
|
|
123
113
|
typescriptPath: require.resolve("typescript", {
|
|
124
114
|
paths: [unpackConfig.root]
|
|
@@ -141,7 +131,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
141
131
|
resolve: {
|
|
142
132
|
alias: {
|
|
143
133
|
"@": path2.resolve(unpackConfig.root, "src"),
|
|
144
|
-
...isTs
|
|
134
|
+
...isTs ? getAliasFromTsconfig() : {},
|
|
145
135
|
...unpackConfig.resolve?.alias
|
|
146
136
|
},
|
|
147
137
|
extensions: [".tsx", ".ts", ".jsx", ".js", ...unpackConfig.resolve?.extensions || []]
|
|
@@ -169,7 +159,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
169
159
|
for (const plugin of getNormalizedPluginsByHook("bundlerConfig", unpackConfig.plugins)) {
|
|
170
160
|
config = await plugin.bundlerConfig(config, {
|
|
171
161
|
unpackConfig,
|
|
172
|
-
mergeConfig
|
|
162
|
+
mergeConfig,
|
|
173
163
|
bundler: webpack
|
|
174
164
|
});
|
|
175
165
|
}
|
|
@@ -177,10 +167,10 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
177
167
|
if (isFunction(unpackConfig.bundlerConfig)) {
|
|
178
168
|
config = await unpackConfig.bundlerConfig(config, {
|
|
179
169
|
bundler: unpackConfig.bundler,
|
|
180
|
-
mergeConfig
|
|
170
|
+
mergeConfig
|
|
181
171
|
});
|
|
182
172
|
} else {
|
|
183
|
-
config =
|
|
173
|
+
config = mergeConfig(config, unpackConfig.bundlerConfig);
|
|
184
174
|
}
|
|
185
175
|
}
|
|
186
176
|
return config;
|