@rsbuild/webpack 1.0.0-alpha.0 → 1.0.0-alpha.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/dist/index.cjs +7 -4
- package/dist/index.js +6 -4
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -156,7 +156,7 @@ async function modifyWebpackConfig(context, webpackConfig, utils) {
|
|
|
156
156
|
utils
|
|
157
157
|
);
|
|
158
158
|
if (context.config.tools?.webpack) {
|
|
159
|
-
modifiedConfig = (0,
|
|
159
|
+
modifiedConfig = (0, import_reduce_configs.reduceConfigsWithContext)({
|
|
160
160
|
initial: modifiedConfig,
|
|
161
161
|
config: context.config.tools.webpack,
|
|
162
162
|
ctx: utils,
|
|
@@ -254,12 +254,13 @@ async function generateWebpackConfig({
|
|
|
254
254
|
);
|
|
255
255
|
return webpackConfig;
|
|
256
256
|
}
|
|
257
|
-
var import_core2, import_shared2;
|
|
257
|
+
var import_core2, import_shared2, import_reduce_configs;
|
|
258
258
|
var init_webpackConfig = __esm({
|
|
259
259
|
"src/webpackConfig.ts"() {
|
|
260
260
|
"use strict";
|
|
261
261
|
import_core2 = require("@rsbuild/core");
|
|
262
262
|
import_shared2 = require("@rsbuild/shared");
|
|
263
|
+
import_reduce_configs = require("reduce-configs");
|
|
263
264
|
init_shared();
|
|
264
265
|
}
|
|
265
266
|
});
|
|
@@ -327,7 +328,8 @@ async function createCompiler({
|
|
|
327
328
|
}) {
|
|
328
329
|
import_core4.logger.debug("create compiler");
|
|
329
330
|
await context.hooks.onBeforeCreateCompiler.call({
|
|
330
|
-
bundlerConfigs: webpackConfigs
|
|
331
|
+
bundlerConfigs: webpackConfigs,
|
|
332
|
+
environments: context.environments
|
|
331
333
|
});
|
|
332
334
|
const { default: webpack2 } = await import("webpack");
|
|
333
335
|
const compiler = webpackConfigs.length === 1 ? webpack2(webpackConfigs[0]) : webpack2(webpackConfigs);
|
|
@@ -345,7 +347,8 @@ async function createCompiler({
|
|
|
345
347
|
if (process.env.NODE_ENV === "development") {
|
|
346
348
|
await context.hooks.onDevCompileDone.call({
|
|
347
349
|
isFirstCompile,
|
|
348
|
-
stats
|
|
350
|
+
stats,
|
|
351
|
+
environments: context.environments
|
|
349
352
|
});
|
|
350
353
|
}
|
|
351
354
|
isFirstCompile = false;
|
package/dist/index.js
CHANGED
|
@@ -155,12 +155,12 @@ var init_inspectConfig = __esm({
|
|
|
155
155
|
// src/webpackConfig.ts
|
|
156
156
|
import {
|
|
157
157
|
__internalHelper as __internalHelper2,
|
|
158
|
-
logger
|
|
159
|
-
reduceConfigsWithContext
|
|
158
|
+
logger
|
|
160
159
|
} from "@rsbuild/core";
|
|
161
160
|
import {
|
|
162
161
|
castArray
|
|
163
162
|
} from "@rsbuild/shared";
|
|
163
|
+
import { reduceConfigsWithContext } from "reduce-configs";
|
|
164
164
|
async function modifyWebpackChain(context, utils, chain) {
|
|
165
165
|
logger.debug("modify webpack chain");
|
|
166
166
|
const [modifiedChain] = await context.hooks.modifyWebpackChain.call(
|
|
@@ -355,7 +355,8 @@ async function createCompiler({
|
|
|
355
355
|
}) {
|
|
356
356
|
logger3.debug("create compiler");
|
|
357
357
|
await context.hooks.onBeforeCreateCompiler.call({
|
|
358
|
-
bundlerConfigs: webpackConfigs
|
|
358
|
+
bundlerConfigs: webpackConfigs,
|
|
359
|
+
environments: context.environments
|
|
359
360
|
});
|
|
360
361
|
const { default: webpack2 } = await import("webpack");
|
|
361
362
|
const compiler = webpackConfigs.length === 1 ? webpack2(webpackConfigs[0]) : webpack2(webpackConfigs);
|
|
@@ -373,7 +374,8 @@ async function createCompiler({
|
|
|
373
374
|
if (process.env.NODE_ENV === "development") {
|
|
374
375
|
await context.hooks.onDevCompileDone.call({
|
|
375
376
|
isFirstCompile,
|
|
376
|
-
stats
|
|
377
|
+
stats,
|
|
378
|
+
environments: context.environments
|
|
377
379
|
});
|
|
378
380
|
}
|
|
379
381
|
isFirstCompile = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"copy-webpack-plugin": "11.0.0",
|
|
27
27
|
"mini-css-extract-plugin": "2.9.0",
|
|
28
|
+
"reduce-configs": "^1.0.0",
|
|
28
29
|
"tsconfig-paths-webpack-plugin": "4.1.0",
|
|
29
30
|
"webpack": "^5.92.1",
|
|
30
|
-
"@rsbuild/core": "1.0.0-alpha.
|
|
31
|
-
"@rsbuild/shared": "1.0.0-alpha.
|
|
31
|
+
"@rsbuild/core": "1.0.0-alpha.2",
|
|
32
|
+
"@rsbuild/shared": "1.0.0-alpha.2"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@types/node": "18.x",
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"cli-truncate": "2.1.0",
|
|
37
38
|
"patch-console": "1.0.0",
|
|
38
39
|
"typescript": "^5.5.2",
|
|
39
|
-
"@scripts/test-helper": "1.0.0-alpha.
|
|
40
|
+
"@scripts/test-helper": "1.0.0-alpha.2"
|
|
40
41
|
},
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"access": "public",
|