@rsbuild/webpack 0.7.0-beta.9 → 0.7.0
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/dist/index.cjs +10 -53
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -57
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -109,19 +109,14 @@ var init_inspectConfig = __esm({
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
// src/shared.ts
|
|
112
|
-
var import_core,
|
|
112
|
+
var import_core, getChainUtils, initRsbuildConfig, createDevServer, startProdServer, formatStats, getDevMiddleware, getStatsOptions;
|
|
113
113
|
var init_shared = __esm({
|
|
114
114
|
"src/shared.ts"() {
|
|
115
115
|
"use strict";
|
|
116
116
|
import_core = require("@rsbuild/core");
|
|
117
117
|
({
|
|
118
|
-
plugins,
|
|
119
|
-
createContext,
|
|
120
|
-
createPublicContext,
|
|
121
|
-
getPluginAPI,
|
|
122
118
|
getChainUtils,
|
|
123
119
|
initRsbuildConfig,
|
|
124
|
-
setCssExtractPlugin,
|
|
125
120
|
createDevServer,
|
|
126
121
|
startProdServer,
|
|
127
122
|
formatStats,
|
|
@@ -193,15 +188,15 @@ async function getConfigUtils(config, chainUtils) {
|
|
|
193
188
|
}
|
|
194
189
|
config.module.rules.unshift(...ruleArr);
|
|
195
190
|
},
|
|
196
|
-
prependPlugins(
|
|
197
|
-
const pluginArr = (0, import_shared2.castArray)(
|
|
191
|
+
prependPlugins(plugins) {
|
|
192
|
+
const pluginArr = (0, import_shared2.castArray)(plugins);
|
|
198
193
|
if (!config.plugins) {
|
|
199
194
|
config.plugins = [];
|
|
200
195
|
}
|
|
201
196
|
config.plugins.unshift(...pluginArr);
|
|
202
197
|
},
|
|
203
|
-
appendPlugins(
|
|
204
|
-
const pluginArr = (0, import_shared2.castArray)(
|
|
198
|
+
appendPlugins(plugins) {
|
|
199
|
+
const pluginArr = (0, import_shared2.castArray)(plugins);
|
|
205
200
|
if (!config.plugins) {
|
|
206
201
|
config.plugins = [];
|
|
207
202
|
}
|
|
@@ -2506,17 +2501,14 @@ __export(src_exports, {
|
|
|
2506
2501
|
module.exports = __toCommonJS(src_exports);
|
|
2507
2502
|
|
|
2508
2503
|
// src/provider.ts
|
|
2509
|
-
var import_shared14 = require("@rsbuild/shared");
|
|
2510
2504
|
init_initConfigs();
|
|
2511
2505
|
init_shared();
|
|
2512
2506
|
var webpackProvider = async ({
|
|
2507
|
+
context,
|
|
2513
2508
|
pluginManager,
|
|
2514
|
-
rsbuildOptions
|
|
2509
|
+
rsbuildOptions,
|
|
2510
|
+
setCssExtractPlugin
|
|
2515
2511
|
}) => {
|
|
2516
|
-
const rsbuildConfig = (0, import_shared14.pickRsbuildConfig)(rsbuildOptions.rsbuildConfig);
|
|
2517
|
-
const context = await createContext(rsbuildOptions, rsbuildConfig, "webpack");
|
|
2518
|
-
const pluginAPI = getPluginAPI({ context, pluginManager });
|
|
2519
|
-
context.pluginAPI = pluginAPI;
|
|
2520
2512
|
const { default: cssExtractPlugin } = await import("mini-css-extract-plugin");
|
|
2521
2513
|
setCssExtractPlugin(cssExtractPlugin);
|
|
2522
2514
|
const createCompiler2 = async () => {
|
|
@@ -2528,46 +2520,11 @@ var webpackProvider = async ({
|
|
|
2528
2520
|
});
|
|
2529
2521
|
return createCompiler3({ context, webpackConfigs });
|
|
2530
2522
|
};
|
|
2523
|
+
const { pluginAdaptor: pluginAdaptor2 } = await Promise.resolve().then(() => (init_plugin(), plugin_exports));
|
|
2524
|
+
pluginManager.addPlugins([pluginAdaptor2()]);
|
|
2531
2525
|
return {
|
|
2532
2526
|
bundler: "webpack",
|
|
2533
|
-
pluginAPI,
|
|
2534
2527
|
createCompiler: createCompiler2,
|
|
2535
|
-
publicContext: createPublicContext(context),
|
|
2536
|
-
async applyDefaultPlugins() {
|
|
2537
|
-
const allPlugins = await Promise.all([
|
|
2538
|
-
plugins.basic(),
|
|
2539
|
-
plugins.entry(),
|
|
2540
|
-
plugins.cache(),
|
|
2541
|
-
plugins.target(),
|
|
2542
|
-
plugins.output(),
|
|
2543
|
-
plugins.resolve(),
|
|
2544
|
-
plugins.fileSize(),
|
|
2545
|
-
plugins.cleanOutput(),
|
|
2546
|
-
plugins.asset(),
|
|
2547
|
-
plugins.html(async (tags) => {
|
|
2548
|
-
const result = await context.hooks.modifyHTMLTags.call(tags);
|
|
2549
|
-
return result[0];
|
|
2550
|
-
}),
|
|
2551
|
-
plugins.wasm(),
|
|
2552
|
-
plugins.moment(),
|
|
2553
|
-
plugins.nodeAddons(),
|
|
2554
|
-
plugins.define(),
|
|
2555
|
-
plugins.css(),
|
|
2556
|
-
plugins.bundleAnalyzer(),
|
|
2557
|
-
plugins.rsdoctor(),
|
|
2558
|
-
plugins.splitChunks(),
|
|
2559
|
-
plugins.startUrl(),
|
|
2560
|
-
plugins.inlineChunk(),
|
|
2561
|
-
plugins.externals(),
|
|
2562
|
-
plugins.performance(),
|
|
2563
|
-
plugins.resourceHints(),
|
|
2564
|
-
plugins.server(),
|
|
2565
|
-
plugins.moduleFederation(),
|
|
2566
|
-
plugins.manifest(),
|
|
2567
|
-
Promise.resolve().then(() => (init_plugin(), plugin_exports)).then((m) => m.pluginAdaptor())
|
|
2568
|
-
]);
|
|
2569
|
-
pluginManager.addPlugins(allPlugins);
|
|
2570
|
-
},
|
|
2571
2528
|
async initConfigs() {
|
|
2572
2529
|
const { webpackConfigs } = await initConfigs({
|
|
2573
2530
|
context,
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -46,11 +46,11 @@ var __publicField = (obj, key, value) => {
|
|
|
46
46
|
return value;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
// ../../../node_modules/.pnpm/@modern-js+module-tools@2.
|
|
49
|
+
// ../../../node_modules/.pnpm/@modern-js+module-tools@2.50.0_eslint@9.3.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
|
|
50
50
|
import { fileURLToPath } from "url";
|
|
51
51
|
import path from "path";
|
|
52
52
|
var init_esm = __esm({
|
|
53
|
-
"../../../node_modules/.pnpm/@modern-js+module-tools@2.
|
|
53
|
+
"../../../node_modules/.pnpm/@modern-js+module-tools@2.50.0_eslint@9.3.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js"() {
|
|
54
54
|
"use strict";
|
|
55
55
|
}
|
|
56
56
|
});
|
|
@@ -132,19 +132,14 @@ var init_inspectConfig = __esm({
|
|
|
132
132
|
|
|
133
133
|
// src/shared.ts
|
|
134
134
|
import { __internalHelper } from "@rsbuild/core";
|
|
135
|
-
var
|
|
135
|
+
var getChainUtils, initRsbuildConfig, createDevServer, startProdServer, formatStats, getDevMiddleware, getStatsOptions;
|
|
136
136
|
var init_shared = __esm({
|
|
137
137
|
"src/shared.ts"() {
|
|
138
138
|
"use strict";
|
|
139
139
|
init_esm();
|
|
140
140
|
({
|
|
141
|
-
plugins,
|
|
142
|
-
createContext,
|
|
143
|
-
createPublicContext,
|
|
144
|
-
getPluginAPI,
|
|
145
141
|
getChainUtils,
|
|
146
142
|
initRsbuildConfig,
|
|
147
|
-
setCssExtractPlugin,
|
|
148
143
|
createDevServer,
|
|
149
144
|
startProdServer,
|
|
150
145
|
formatStats,
|
|
@@ -224,15 +219,15 @@ async function getConfigUtils(config, chainUtils) {
|
|
|
224
219
|
}
|
|
225
220
|
config.module.rules.unshift(...ruleArr);
|
|
226
221
|
},
|
|
227
|
-
prependPlugins(
|
|
228
|
-
const pluginArr = castArray(
|
|
222
|
+
prependPlugins(plugins) {
|
|
223
|
+
const pluginArr = castArray(plugins);
|
|
229
224
|
if (!config.plugins) {
|
|
230
225
|
config.plugins = [];
|
|
231
226
|
}
|
|
232
227
|
config.plugins.unshift(...pluginArr);
|
|
233
228
|
},
|
|
234
|
-
appendPlugins(
|
|
235
|
-
const pluginArr = castArray(
|
|
229
|
+
appendPlugins(plugins) {
|
|
230
|
+
const pluginArr = castArray(plugins);
|
|
236
231
|
if (!config.plugins) {
|
|
237
232
|
config.plugins = [];
|
|
238
233
|
}
|
|
@@ -2572,17 +2567,12 @@ init_esm();
|
|
|
2572
2567
|
init_esm();
|
|
2573
2568
|
init_initConfigs();
|
|
2574
2569
|
init_shared();
|
|
2575
|
-
import {
|
|
2576
|
-
pickRsbuildConfig
|
|
2577
|
-
} from "@rsbuild/shared";
|
|
2578
2570
|
var webpackProvider = async ({
|
|
2571
|
+
context,
|
|
2579
2572
|
pluginManager,
|
|
2580
|
-
rsbuildOptions
|
|
2573
|
+
rsbuildOptions,
|
|
2574
|
+
setCssExtractPlugin
|
|
2581
2575
|
}) => {
|
|
2582
|
-
const rsbuildConfig = pickRsbuildConfig(rsbuildOptions.rsbuildConfig);
|
|
2583
|
-
const context = await createContext(rsbuildOptions, rsbuildConfig, "webpack");
|
|
2584
|
-
const pluginAPI = getPluginAPI({ context, pluginManager });
|
|
2585
|
-
context.pluginAPI = pluginAPI;
|
|
2586
2576
|
const { default: cssExtractPlugin } = await import("mini-css-extract-plugin");
|
|
2587
2577
|
setCssExtractPlugin(cssExtractPlugin);
|
|
2588
2578
|
const createCompiler2 = async () => {
|
|
@@ -2594,46 +2584,11 @@ var webpackProvider = async ({
|
|
|
2594
2584
|
});
|
|
2595
2585
|
return createCompiler3({ context, webpackConfigs });
|
|
2596
2586
|
};
|
|
2587
|
+
const { pluginAdaptor: pluginAdaptor2 } = await Promise.resolve().then(() => (init_plugin(), plugin_exports));
|
|
2588
|
+
pluginManager.addPlugins([pluginAdaptor2()]);
|
|
2597
2589
|
return {
|
|
2598
2590
|
bundler: "webpack",
|
|
2599
|
-
pluginAPI,
|
|
2600
2591
|
createCompiler: createCompiler2,
|
|
2601
|
-
publicContext: createPublicContext(context),
|
|
2602
|
-
async applyDefaultPlugins() {
|
|
2603
|
-
const allPlugins = await Promise.all([
|
|
2604
|
-
plugins.basic(),
|
|
2605
|
-
plugins.entry(),
|
|
2606
|
-
plugins.cache(),
|
|
2607
|
-
plugins.target(),
|
|
2608
|
-
plugins.output(),
|
|
2609
|
-
plugins.resolve(),
|
|
2610
|
-
plugins.fileSize(),
|
|
2611
|
-
plugins.cleanOutput(),
|
|
2612
|
-
plugins.asset(),
|
|
2613
|
-
plugins.html(async (tags) => {
|
|
2614
|
-
const result = await context.hooks.modifyHTMLTags.call(tags);
|
|
2615
|
-
return result[0];
|
|
2616
|
-
}),
|
|
2617
|
-
plugins.wasm(),
|
|
2618
|
-
plugins.moment(),
|
|
2619
|
-
plugins.nodeAddons(),
|
|
2620
|
-
plugins.define(),
|
|
2621
|
-
plugins.css(),
|
|
2622
|
-
plugins.bundleAnalyzer(),
|
|
2623
|
-
plugins.rsdoctor(),
|
|
2624
|
-
plugins.splitChunks(),
|
|
2625
|
-
plugins.startUrl(),
|
|
2626
|
-
plugins.inlineChunk(),
|
|
2627
|
-
plugins.externals(),
|
|
2628
|
-
plugins.performance(),
|
|
2629
|
-
plugins.resourceHints(),
|
|
2630
|
-
plugins.server(),
|
|
2631
|
-
plugins.moduleFederation(),
|
|
2632
|
-
plugins.manifest(),
|
|
2633
|
-
Promise.resolve().then(() => (init_plugin(), plugin_exports)).then((m) => m.pluginAdaptor())
|
|
2634
|
-
]);
|
|
2635
|
-
pluginManager.addPlugins(allPlugins);
|
|
2636
|
-
},
|
|
2637
2592
|
async initConfigs() {
|
|
2638
2593
|
const { webpackConfigs } = await initConfigs({
|
|
2639
2594
|
context,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "0.7.0
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"mini-css-extract-plugin": "2.8.1",
|
|
27
26
|
"copy-webpack-plugin": "9.1.0",
|
|
27
|
+
"mini-css-extract-plugin": "2.8.1",
|
|
28
28
|
"postcss": "^8.4.38",
|
|
29
29
|
"tsconfig-paths-webpack-plugin": "4.1.0",
|
|
30
30
|
"webpack": "^5.91.0",
|
|
31
|
-
"@rsbuild/core": "0.7.0
|
|
32
|
-
"@rsbuild/shared": "0.7.0
|
|
31
|
+
"@rsbuild/core": "0.7.0",
|
|
32
|
+
"@rsbuild/shared": "0.7.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "18.x",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"cli-truncate": "2.1.0",
|
|
38
38
|
"patch-console": "1.0.0",
|
|
39
39
|
"typescript": "^5.4.2",
|
|
40
|
-
"@scripts/test-helper": "0.7.0
|
|
40
|
+
"@scripts/test-helper": "0.7.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public",
|