@rsbuild/webpack 1.2.2 → 1.3.0-beta.1
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/README.md +11 -11
- package/dist/{511.cjs → 13.cjs} +4 -5
- package/dist/{636.js → 801.js} +6 -6
- package/dist/997.cjs +4 -5
- package/dist/997.js +6 -6
- package/dist/index.cjs +13 -25
- package/dist/index.js +17 -29
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://rsbuild.dev" target="blank"><img src="https://assets.rspack.dev/rsbuild/rsbuild-banner.png" alt="Rsbuild Logo" /></a>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
# @rsbuild/webpack
|
|
6
2
|
|
|
7
3
|
This package can be used to switch Rsbuild's bundler from Rspack to webpack.
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://npmjs.com/package/@rsbuild/webpack">
|
|
7
|
+
<img src="https://img.shields.io/npm/v/@rsbuild/webpack?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
|
|
8
|
+
</a>
|
|
9
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
|
|
10
|
+
<a href="https://npmcharts.com/compare/@rsbuild/webpack?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/webpack.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
> Note that this package is mainly used for compatibility with Modern.js and Rsbuild internal testing. We do not recommend you to use this package in a Rsbuild project. The API of the current package may change over iterations.
|
|
10
14
|
|
|
11
15
|
## Usage
|
|
12
16
|
|
|
@@ -29,12 +33,8 @@ export default defineConfig({
|
|
|
29
33
|
|
|
30
34
|
## Documentation
|
|
31
35
|
|
|
32
|
-
https://rsbuild.dev
|
|
33
|
-
|
|
34
|
-
## Contributing
|
|
35
|
-
|
|
36
|
-
Please read the [Contributing Guide](https://github.com/web-infra-dev/rsbuild/blob/main/CONTRIBUTING.md).
|
|
36
|
+
See [Documentation](https://rsbuild.dev).
|
|
37
37
|
|
|
38
38
|
## License
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
[MIT](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE).
|
package/dist/{511.cjs → 13.cjs}
RENAMED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
3
2
|
exports.ids = [
|
|
4
|
-
'
|
|
3
|
+
'13'
|
|
5
4
|
], exports.modules = {
|
|
6
5
|
"./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
6
|
__webpack_require__.d(__webpack_exports__, {
|
|
@@ -170,7 +169,7 @@ exports.ids = [
|
|
|
170
169
|
let hrtime = process.hrtime(startTime), seconds = hrtime[0] + hrtime[1] / 1e9;
|
|
171
170
|
if (this.compileTime = this.prettyTime(seconds), startTime = null, !this.hasCompileErrors) {
|
|
172
171
|
let suffix = this.id ? external_picocolors_default().gray(` (${this.id})`) : '';
|
|
173
|
-
core_.logger.ready(`
|
|
172
|
+
core_.logger.ready(`built in ${this.compileTime} ${suffix}`);
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
175
|
});
|
|
@@ -182,8 +181,8 @@ exports.ids = [
|
|
|
182
181
|
let suffix = external_picocolors_default().gray(`(${id})`);
|
|
183
182
|
if (done) {
|
|
184
183
|
if (100 === prevPercentage) return;
|
|
185
|
-
prevPercentage = 100, hasErrors ? core_.logger.error(`
|
|
186
|
-
} else current - prevPercentage > 10 && (prevPercentage = current, core_.logger.info(`
|
|
184
|
+
prevPercentage = 100, hasErrors ? core_.logger.error(`built failed in ${compileTime} ${suffix}`) : core_.logger.ready(`built in ${compileTime} ${suffix}`);
|
|
185
|
+
} else current - prevPercentage > 10 && (prevPercentage = current, core_.logger.info(`build progress: ${current.toFixed(0)}% ${suffix}`));
|
|
187
186
|
}
|
|
188
187
|
}), friendlyPercentage = createFriendlyPercentage();
|
|
189
188
|
super({
|
package/dist/{636.js → 801.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const
|
|
2
|
-
'
|
|
1
|
+
export const __webpack_ids__ = [
|
|
2
|
+
'801'
|
|
3
3
|
];
|
|
4
|
-
export const
|
|
4
|
+
export const __webpack_modules__ = {
|
|
5
5
|
"./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
6
|
__webpack_require__.d(__webpack_exports__, {
|
|
7
7
|
ProgressPlugin: ()=>ProgressPlugin
|
|
@@ -169,7 +169,7 @@ export const modules = {
|
|
|
169
169
|
let hrtime = process.hrtime(startTime), seconds = hrtime[0] + hrtime[1] / 1e9;
|
|
170
170
|
if (this.compileTime = this.prettyTime(seconds), startTime = null, !this.hasCompileErrors) {
|
|
171
171
|
let suffix = this.id ? external_picocolors_.default.gray(` (${this.id})`) : '';
|
|
172
|
-
core_.logger.ready(`
|
|
172
|
+
core_.logger.ready(`built in ${this.compileTime} ${suffix}`);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
});
|
|
@@ -181,8 +181,8 @@ export const modules = {
|
|
|
181
181
|
let suffix = external_picocolors_.default.gray(`(${id})`);
|
|
182
182
|
if (done) {
|
|
183
183
|
if (100 === prevPercentage) return;
|
|
184
|
-
prevPercentage = 100, hasErrors ? core_.logger.error(`
|
|
185
|
-
} else current - prevPercentage > 10 && (prevPercentage = current, core_.logger.info(`
|
|
184
|
+
prevPercentage = 100, hasErrors ? core_.logger.error(`built failed in ${compileTime} ${suffix}`) : core_.logger.ready(`built in ${compileTime} ${suffix}`);
|
|
185
|
+
} else current - prevPercentage > 10 && (prevPercentage = current, core_.logger.info(`build progress: ${current.toFixed(0)}% ${suffix}`));
|
|
186
186
|
}
|
|
187
187
|
}), friendlyPercentage = createFriendlyPercentage();
|
|
188
188
|
super({
|
package/dist/997.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
2
1
|
exports.ids = [
|
|
3
2
|
'997'
|
|
4
3
|
], exports.modules = {
|
|
@@ -87,7 +86,7 @@ exports.ids = [
|
|
|
87
86
|
});
|
|
88
87
|
}, makeDynamicStyles = (wrap, targetSpace, identity, isBackground)=>{
|
|
89
88
|
void 0 === colorConvert && (colorConvert = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
|
|
90
|
-
let offset =
|
|
89
|
+
let offset = 10 * !!isBackground, styles = {};
|
|
91
90
|
for (let [sourceSpace, suite] of Object.entries(colorConvert)){
|
|
92
91
|
let name = 'ansi16' === sourceSpace ? 'ansi' : sourceSpace;
|
|
93
92
|
sourceSpace === targetSpace ? styles[name] = wrap(identity, offset) : 'object' == typeof suite && (styles[name] = wrap(suite[targetSpace], offset));
|
|
@@ -702,10 +701,10 @@ exports.ids = [
|
|
|
702
701
|
0xFF & integer
|
|
703
702
|
];
|
|
704
703
|
}, convert.rgb.hcg = function(rgb) {
|
|
705
|
-
let grayscale;
|
|
704
|
+
let grayscale, hue;
|
|
706
705
|
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min;
|
|
707
706
|
return grayscale = chroma < 1 ? min / (1 - chroma) : 0, [
|
|
708
|
-
(chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1
|
|
707
|
+
360 * ((chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1),
|
|
709
708
|
100 * chroma,
|
|
710
709
|
100 * grayscale
|
|
711
710
|
];
|
|
@@ -1664,7 +1663,7 @@ exports.ids = [
|
|
|
1664
1663
|
},
|
|
1665
1664
|
"../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
|
|
1666
1665
|
"use strict";
|
|
1667
|
-
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) &&
|
|
1666
|
+
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && (codePoint >= 0x1100 && (codePoint <= 0x115F || 0x2329 === codePoint || 0x232A === codePoint || 0x2E80 <= codePoint && codePoint <= 0x3247 && 0x303F !== codePoint || 0x3250 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE6B || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x3FFFD) || !1);
|
|
1668
1667
|
module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
|
|
1669
1668
|
},
|
|
1670
1669
|
"../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
package/dist/997.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const __webpack_ids__ = [
|
|
2
2
|
'997'
|
|
3
3
|
];
|
|
4
|
-
export const
|
|
4
|
+
export const __webpack_modules__ = {
|
|
5
5
|
"../../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js": function(module) {
|
|
6
6
|
let ansiEscapes = module.exports;
|
|
7
7
|
module.exports.default = ansiEscapes;
|
|
@@ -84,7 +84,7 @@ export const modules = {
|
|
|
84
84
|
});
|
|
85
85
|
}, makeDynamicStyles = (wrap, targetSpace, identity, isBackground)=>{
|
|
86
86
|
void 0 === colorConvert && (colorConvert = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
|
|
87
|
-
let offset =
|
|
87
|
+
let offset = 10 * !!isBackground, styles = {};
|
|
88
88
|
for (let [sourceSpace, suite] of Object.entries(colorConvert)){
|
|
89
89
|
let name = 'ansi16' === sourceSpace ? 'ansi' : sourceSpace;
|
|
90
90
|
sourceSpace === targetSpace ? styles[name] = wrap(identity, offset) : 'object' == typeof suite && (styles[name] = wrap(suite[targetSpace], offset));
|
|
@@ -697,10 +697,10 @@ export const modules = {
|
|
|
697
697
|
0xFF & integer
|
|
698
698
|
];
|
|
699
699
|
}, convert.rgb.hcg = function(rgb) {
|
|
700
|
-
let grayscale;
|
|
700
|
+
let grayscale, hue;
|
|
701
701
|
let r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255, max = Math.max(Math.max(r, g), b), min = Math.min(Math.min(r, g), b), chroma = max - min;
|
|
702
702
|
return grayscale = chroma < 1 ? min / (1 - chroma) : 0, [
|
|
703
|
-
(chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1
|
|
703
|
+
360 * ((chroma <= 0 ? 0 : max === r ? (g - b) / chroma % 6 : max === g ? 2 + (b - r) / chroma : 4 + (r - g) / chroma) / 6 % 1),
|
|
704
704
|
100 * chroma,
|
|
705
705
|
100 * grayscale
|
|
706
706
|
];
|
|
@@ -1656,7 +1656,7 @@ export const modules = {
|
|
|
1656
1656
|
};
|
|
1657
1657
|
},
|
|
1658
1658
|
"../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
|
|
1659
|
-
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) &&
|
|
1659
|
+
let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && (codePoint >= 0x1100 && (codePoint <= 0x115F || 0x2329 === codePoint || 0x232A === codePoint || 0x2E80 <= codePoint && codePoint <= 0x3247 && 0x303F !== codePoint || 0x3250 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE6B || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x3FFFD) || !1);
|
|
1660
1660
|
module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
|
|
1661
1661
|
},
|
|
1662
1662
|
"../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
package/dist/index.cjs
CHANGED
|
@@ -42,29 +42,17 @@ function __webpack_require__(moduleId) {
|
|
|
42
42
|
};
|
|
43
43
|
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.loaded = !0, module.exports;
|
|
44
44
|
}
|
|
45
|
-
__webpack_require__.m = __webpack_modules__, __webpack_require__.n =
|
|
46
|
-
var getter = module && module.__esModule ?
|
|
47
|
-
return module.default;
|
|
48
|
-
} : function() {
|
|
49
|
-
return module;
|
|
50
|
-
};
|
|
45
|
+
__webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
46
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
51
47
|
return __webpack_require__.d(getter, {
|
|
52
48
|
a: getter
|
|
53
49
|
}), getter;
|
|
54
|
-
}, __webpack_require__.d =
|
|
50
|
+
}, __webpack_require__.d = (exports1, definition)=>{
|
|
55
51
|
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
|
|
56
52
|
enumerable: !0,
|
|
57
53
|
get: definition[key]
|
|
58
54
|
});
|
|
59
|
-
}, __webpack_require__.f = {}, __webpack_require__.e =
|
|
60
|
-
return Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {
|
|
61
|
-
return __webpack_require__.f[key](chunkId, promises), promises;
|
|
62
|
-
}, []));
|
|
63
|
-
}, __webpack_require__.u = function(chunkId) {
|
|
64
|
-
return "" + chunkId + ".cjs";
|
|
65
|
-
}, __webpack_require__.o = function(obj, prop) {
|
|
66
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
67
|
-
}, __webpack_require__.r = function(exports1) {
|
|
55
|
+
}, __webpack_require__.f = {}, __webpack_require__.e = (chunkId)=>Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=>(__webpack_require__.f[key](chunkId, promises), promises), [])), __webpack_require__.u = (chunkId)=>"" + chunkId + ".cjs", __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = function(exports1) {
|
|
68
56
|
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
69
57
|
value: 'Module'
|
|
70
58
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
@@ -75,13 +63,13 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = function(mo
|
|
|
75
63
|
}, (()=>{
|
|
76
64
|
var installedChunks = {
|
|
77
65
|
980: 1
|
|
78
|
-
}, installChunk =
|
|
66
|
+
}, installChunk = (chunk)=>{
|
|
79
67
|
var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;
|
|
80
68
|
for(var moduleId in moreModules)__webpack_require__.o(moreModules, moduleId) && (__webpack_require__.m[moduleId] = moreModules[moduleId]);
|
|
81
69
|
runtime && runtime(__webpack_require__);
|
|
82
70
|
for(var i = 0; i < chunkIds.length; i++)installedChunks[chunkIds[i]] = 1;
|
|
83
71
|
};
|
|
84
|
-
__webpack_require__.f.require =
|
|
72
|
+
__webpack_require__.f.require = (chunkId, promises)=>{
|
|
85
73
|
installedChunks[chunkId] || installChunk(require("./" + __webpack_require__.u(chunkId)));
|
|
86
74
|
};
|
|
87
75
|
})();
|
|
@@ -134,7 +122,7 @@ var __webpack_exports__ = {};
|
|
|
134
122
|
async function modifyWebpackChain(context, utils, chain) {
|
|
135
123
|
var _utils_environment_config_tools;
|
|
136
124
|
core_.logger.debug('modify webpack chain');
|
|
137
|
-
let [modifiedChain] = await context.hooks.modifyWebpackChain.
|
|
125
|
+
let [modifiedChain] = await context.hooks.modifyWebpackChain.callChain({
|
|
138
126
|
environment: utils.environment.name,
|
|
139
127
|
args: [
|
|
140
128
|
chain,
|
|
@@ -147,7 +135,7 @@ var __webpack_exports__ = {};
|
|
|
147
135
|
async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
148
136
|
var _utils_environment_config_tools;
|
|
149
137
|
core_.logger.debug('modify webpack config');
|
|
150
|
-
let [modifiedConfig] = await context.hooks.modifyWebpackConfig.
|
|
138
|
+
let [modifiedConfig] = await context.hooks.modifyWebpackConfig.callChain({
|
|
151
139
|
environment: utils.environment.name,
|
|
152
140
|
args: [
|
|
153
141
|
webpackConfig,
|
|
@@ -223,7 +211,7 @@ var __webpack_exports__ = {};
|
|
|
223
211
|
async function createCompiler_createCompiler(options) {
|
|
224
212
|
core_.logger.debug('create compiler');
|
|
225
213
|
let { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
|
|
226
|
-
await context.hooks.onBeforeCreateCompiler.
|
|
214
|
+
await context.hooks.onBeforeCreateCompiler.callBatch({
|
|
227
215
|
bundlerConfigs: webpackConfigs,
|
|
228
216
|
environments: context.environments
|
|
229
217
|
});
|
|
@@ -238,12 +226,12 @@ var __webpack_exports__ = {};
|
|
|
238
226
|
};
|
|
239
227
|
return compiler.hooks.done.tap('rsbuild:done', (stats)=>{
|
|
240
228
|
done(stats);
|
|
241
|
-
}), 'dev' === context.
|
|
229
|
+
}), 'dev' === context.action && helpers.registerDevHook({
|
|
242
230
|
compiler,
|
|
243
231
|
context,
|
|
244
232
|
bundlerConfigs: webpackConfigs,
|
|
245
233
|
MultiStatsCtor: MultiStats_js_default()
|
|
246
|
-
}), await context.hooks.onAfterCreateCompiler.
|
|
234
|
+
}), await context.hooks.onAfterCreateCompiler.callBatch({
|
|
247
235
|
compiler,
|
|
248
236
|
environments: context.environments
|
|
249
237
|
}), core_.logger.debug('create compiler done'), {
|
|
@@ -276,7 +264,7 @@ var __webpack_exports__ = {};
|
|
|
276
264
|
};
|
|
277
265
|
let { stats } = await new Promise((resolve, reject)=>{
|
|
278
266
|
compiler.run((err, stats)=>{
|
|
279
|
-
err ? reject(err) : (null == stats ? void 0 : stats.hasErrors()) ? reject(Error('
|
|
267
|
+
err ? reject(err) : (null == stats ? void 0 : stats.hasErrors()) ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
|
|
280
268
|
closeErr && core_.logger.error(closeErr), resolve({
|
|
281
269
|
stats
|
|
282
270
|
});
|
|
@@ -327,7 +315,7 @@ var __webpack_exports__ = {};
|
|
|
327
315
|
if (progress) {
|
|
328
316
|
let { ProgressPlugin } = await Promise.all([
|
|
329
317
|
__webpack_require__.e("997"),
|
|
330
|
-
__webpack_require__.e("
|
|
318
|
+
__webpack_require__.e("13")
|
|
331
319
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
|
|
332
320
|
chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
|
|
333
321
|
{
|
package/dist/index.js
CHANGED
|
@@ -34,46 +34,34 @@ function __webpack_require__(moduleId) {
|
|
|
34
34
|
};
|
|
35
35
|
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.loaded = !0, module.exports;
|
|
36
36
|
}
|
|
37
|
-
__webpack_require__.m = __webpack_modules__, __webpack_require__.n =
|
|
38
|
-
var getter = module && module.__esModule ?
|
|
39
|
-
return module.default;
|
|
40
|
-
} : function() {
|
|
41
|
-
return module;
|
|
42
|
-
};
|
|
37
|
+
__webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
|
|
38
|
+
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
43
39
|
return __webpack_require__.d(getter, {
|
|
44
40
|
a: getter
|
|
45
41
|
}), getter;
|
|
46
|
-
}, __webpack_require__.d =
|
|
42
|
+
}, __webpack_require__.d = (exports, definition)=>{
|
|
47
43
|
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, {
|
|
48
44
|
enumerable: !0,
|
|
49
45
|
get: definition[key]
|
|
50
46
|
});
|
|
51
|
-
}, __webpack_require__.f = {}, __webpack_require__.e =
|
|
52
|
-
return Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {
|
|
53
|
-
return __webpack_require__.f[key](chunkId, promises), promises;
|
|
54
|
-
}, []));
|
|
55
|
-
}, __webpack_require__.u = function(chunkId) {
|
|
56
|
-
return "" + chunkId + ".js";
|
|
57
|
-
}, __webpack_require__.o = function(obj, prop) {
|
|
58
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
59
|
-
}, __webpack_require__.nmd = function(module) {
|
|
47
|
+
}, __webpack_require__.f = {}, __webpack_require__.e = (chunkId)=>Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key)=>(__webpack_require__.f[key](chunkId, promises), promises), [])), __webpack_require__.u = (chunkId)=>"" + chunkId + ".js", __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.nmd = function(module) {
|
|
60
48
|
return module.paths = [], module.children || (module.children = []), module;
|
|
61
49
|
}, installedChunks = {
|
|
62
50
|
980: 0
|
|
63
|
-
}, installChunk =
|
|
64
|
-
var moduleId, chunkId,
|
|
65
|
-
for(moduleId in
|
|
66
|
-
for(
|
|
51
|
+
}, installChunk = (data)=>{
|
|
52
|
+
var moduleId, chunkId, __webpack_ids__ = data.__webpack_ids__, __webpack_modules__ = data.__webpack_modules__, __webpack_runtime__ = data.__webpack_runtime__, i = 0;
|
|
53
|
+
for(moduleId in __webpack_modules__)__webpack_require__.o(__webpack_modules__, moduleId) && (__webpack_require__.m[moduleId] = __webpack_modules__[moduleId]);
|
|
54
|
+
for(__webpack_runtime__ && __webpack_runtime__(__webpack_require__); i < __webpack_ids__.length; i++)chunkId = __webpack_ids__[i], __webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId] && installedChunks[chunkId][0](), installedChunks[__webpack_ids__[i]] = 0;
|
|
67
55
|
}, __webpack_require__.f.j = function(chunkId, promises) {
|
|
68
56
|
var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : void 0;
|
|
69
57
|
if (0 !== installedChunkData) {
|
|
70
58
|
if (installedChunkData) promises.push(installedChunkData[1]);
|
|
71
59
|
else {
|
|
72
|
-
var promise = import("./" + __webpack_require__.u(chunkId)).then(installChunk,
|
|
60
|
+
var promise = import("./" + __webpack_require__.u(chunkId)).then(installChunk, (e)=>{
|
|
73
61
|
throw 0 !== installedChunks[chunkId] && (installedChunks[chunkId] = void 0), e;
|
|
74
62
|
}), promise = Promise.race([
|
|
75
63
|
promise,
|
|
76
|
-
new Promise(
|
|
64
|
+
new Promise((resolve)=>{
|
|
77
65
|
installedChunkData = installedChunks[chunkId] = [
|
|
78
66
|
resolve
|
|
79
67
|
];
|
|
@@ -125,7 +113,7 @@ let castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
|
|
|
125
113
|
async function modifyWebpackChain(context, utils, chain) {
|
|
126
114
|
var _utils_environment_config_tools;
|
|
127
115
|
core_.logger.debug('modify webpack chain');
|
|
128
|
-
let [modifiedChain] = await context.hooks.modifyWebpackChain.
|
|
116
|
+
let [modifiedChain] = await context.hooks.modifyWebpackChain.callChain({
|
|
129
117
|
environment: utils.environment.name,
|
|
130
118
|
args: [
|
|
131
119
|
chain,
|
|
@@ -138,7 +126,7 @@ async function modifyWebpackChain(context, utils, chain) {
|
|
|
138
126
|
async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
139
127
|
var _utils_environment_config_tools;
|
|
140
128
|
core_.logger.debug('modify webpack config');
|
|
141
|
-
let [modifiedConfig] = await context.hooks.modifyWebpackConfig.
|
|
129
|
+
let [modifiedConfig] = await context.hooks.modifyWebpackConfig.callChain({
|
|
142
130
|
environment: utils.environment.name,
|
|
143
131
|
args: [
|
|
144
132
|
webpackConfig,
|
|
@@ -214,7 +202,7 @@ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers })
|
|
|
214
202
|
async function createCompiler_createCompiler(options) {
|
|
215
203
|
core_.logger.debug('create compiler');
|
|
216
204
|
let { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
|
|
217
|
-
await context.hooks.onBeforeCreateCompiler.
|
|
205
|
+
await context.hooks.onBeforeCreateCompiler.callBatch({
|
|
218
206
|
bundlerConfigs: webpackConfigs,
|
|
219
207
|
environments: context.environments
|
|
220
208
|
});
|
|
@@ -229,12 +217,12 @@ async function createCompiler_createCompiler(options) {
|
|
|
229
217
|
};
|
|
230
218
|
return compiler.hooks.done.tap('rsbuild:done', (stats)=>{
|
|
231
219
|
done(stats);
|
|
232
|
-
}), 'dev' === context.
|
|
220
|
+
}), 'dev' === context.action && helpers.registerDevHook({
|
|
233
221
|
compiler,
|
|
234
222
|
context,
|
|
235
223
|
bundlerConfigs: webpackConfigs,
|
|
236
224
|
MultiStatsCtor: __WEBPACK_EXTERNAL_MODULE_webpack_lib_MultiStats_js_a72a7b8d__.default
|
|
237
|
-
}), await context.hooks.onAfterCreateCompiler.
|
|
225
|
+
}), await context.hooks.onAfterCreateCompiler.callBatch({
|
|
238
226
|
compiler,
|
|
239
227
|
environments: context.environments
|
|
240
228
|
}), core_.logger.debug('create compiler done'), {
|
|
@@ -267,7 +255,7 @@ let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
|
|
|
267
255
|
};
|
|
268
256
|
let { stats } = await new Promise((resolve, reject)=>{
|
|
269
257
|
compiler.run((err, stats)=>{
|
|
270
|
-
err ? reject(err) : (null == stats ? void 0 : stats.hasErrors()) ? reject(Error('
|
|
258
|
+
err ? reject(err) : (null == stats ? void 0 : stats.hasErrors()) ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
|
|
271
259
|
closeErr && core_.logger.error(closeErr), resolve({
|
|
272
260
|
stats
|
|
273
261
|
});
|
|
@@ -315,7 +303,7 @@ let getMainFields = (chain, target)=>{
|
|
|
315
303
|
if (progress) {
|
|
316
304
|
let { ProgressPlugin } = await Promise.all([
|
|
317
305
|
__webpack_require__.e("997"),
|
|
318
|
-
__webpack_require__.e("
|
|
306
|
+
__webpack_require__.e("801")
|
|
319
307
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
|
|
320
308
|
chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
|
|
321
309
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-beta.1",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"picocolors": "^1.1.1",
|
|
30
30
|
"reduce-configs": "^1.1.0",
|
|
31
31
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
32
|
-
"webpack": "^5.
|
|
32
|
+
"webpack": "^5.98.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@rslib/core": "0.4
|
|
36
|
-
"@types/node": "^22.13.
|
|
35
|
+
"@rslib/core": "0.5.4",
|
|
36
|
+
"@types/node": "^22.13.10",
|
|
37
37
|
"ansi-escapes": "4.3.2",
|
|
38
38
|
"cli-truncate": "2.1.0",
|
|
39
39
|
"patch-console": "1.0.0",
|
|
40
|
-
"typescript": "^5.
|
|
41
|
-
"@rsbuild/core": "1.
|
|
40
|
+
"typescript": "^5.8.2",
|
|
41
|
+
"@rsbuild/core": "1.3.0-beta.1",
|
|
42
42
|
"@scripts/test-helper": "1.0.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|