@rsbuild/webpack 0.0.25 → 0.0.26
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.
|
@@ -24,11 +24,12 @@ __export(createContext_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(createContext_exports);
|
|
25
25
|
var import_path = require("path");
|
|
26
26
|
var import_shared = require("@rsbuild/shared");
|
|
27
|
+
var import_rspack_provider = require("@rsbuild/core/rspack-provider");
|
|
27
28
|
var import_initHooks = require("./initHooks");
|
|
28
29
|
var import_defaults = require("../config/defaults");
|
|
29
30
|
function createPrimaryContext(options, userRsbuildConfig) {
|
|
30
31
|
const rsbuildConfig = (0, import_defaults.withDefaultConfig)(userRsbuildConfig);
|
|
31
|
-
const context = (0,
|
|
32
|
+
const context = (0, import_rspack_provider.createContextByConfig)(
|
|
32
33
|
options,
|
|
33
34
|
"webpack",
|
|
34
35
|
rsbuildConfig.source,
|
package/dist/core/initConfigs.js
CHANGED
|
@@ -22,6 +22,7 @@ __export(initConfigs_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(initConfigs_exports);
|
|
24
24
|
var import_shared = require("@rsbuild/shared");
|
|
25
|
+
var import_rspack_provider = require("@rsbuild/core/rspack-provider");
|
|
25
26
|
var import_inspectConfig = require("./inspectConfig");
|
|
26
27
|
var import_webpackConfig = require("./webpackConfig");
|
|
27
28
|
var import_normalize = require("../config/normalize");
|
|
@@ -46,7 +47,7 @@ async function initConfigs({
|
|
|
46
47
|
await modifyRsbuildConfig(context);
|
|
47
48
|
const normalizedConfig = (0, import_normalize.normalizeConfig)(context.config);
|
|
48
49
|
context.normalizedConfig = normalizedConfig;
|
|
49
|
-
(0,
|
|
50
|
+
(0, import_rspack_provider.updateContextByNormalizedConfig)(context, context.normalizedConfig);
|
|
50
51
|
const targets = (0, import_shared.castArray)(rsbuildOptions.target);
|
|
51
52
|
const webpackConfigs = await Promise.all(
|
|
52
53
|
targets.map((target) => (0, import_webpackConfig.generateWebpackConfig)({ target, context }))
|
package/dist/core/initPlugins.js
CHANGED
|
@@ -22,12 +22,13 @@ __export(initPlugins_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(initPlugins_exports);
|
|
24
24
|
var import_shared = require("@rsbuild/shared");
|
|
25
|
+
var import_rspack_provider = require("@rsbuild/core/rspack-provider");
|
|
25
26
|
function getPluginAPI({
|
|
26
27
|
context,
|
|
27
28
|
pluginStore
|
|
28
29
|
}) {
|
|
29
30
|
const { hooks } = context;
|
|
30
|
-
const publicContext = (0,
|
|
31
|
+
const publicContext = (0, import_rspack_provider.createPublicContext)(context);
|
|
31
32
|
const getRsbuildConfig = () => {
|
|
32
33
|
if (!context.normalizedConfig) {
|
|
33
34
|
throw new Error(
|
package/dist/plugins/css.js
CHANGED
|
@@ -46,7 +46,6 @@ async function applyBaseCSSRule({
|
|
|
46
46
|
target
|
|
47
47
|
);
|
|
48
48
|
const enableExtractCSS = (0, import_shared.isUseCssExtract)(config, target);
|
|
49
|
-
const enableCssMinify = !enableExtractCSS && isProd;
|
|
50
49
|
const enableSourceMap = (0, import_shared.isUseCssSourceMap)(config);
|
|
51
50
|
const enableCSSModuleTS = Boolean(config.output.enableCssModuleTSDeclaration);
|
|
52
51
|
const localIdentName = (0, import_shared.getCssModuleLocalIdentName)(config, isProd);
|
|
@@ -90,8 +89,7 @@ async function applyBaseCSSRule({
|
|
|
90
89
|
const postcssLoaderOptions = (0, import_shared.getPostcssConfig)({
|
|
91
90
|
enableSourceMap,
|
|
92
91
|
browserslist,
|
|
93
|
-
config
|
|
94
|
-
enableCssMinify
|
|
92
|
+
config
|
|
95
93
|
});
|
|
96
94
|
rule.use(CHAIN_ID.USE.POSTCSS).loader(getCompiledPath("postcss-loader")).options(postcssLoaderOptions).end();
|
|
97
95
|
}
|
package/dist/plugins/react.js
CHANGED
|
@@ -31,12 +31,13 @@ __export(react_exports, {
|
|
|
31
31
|
pluginReactWebpack: () => pluginReactWebpack
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(react_exports);
|
|
34
|
+
var import_plugin_react = require("@rsbuild/plugin-react");
|
|
34
35
|
var import_shared = require("@rsbuild/shared");
|
|
35
36
|
const pluginReactWebpack = () => ({
|
|
36
37
|
name: "plugin-react-webpack",
|
|
37
38
|
setup(api) {
|
|
38
39
|
api.modifyRsbuildConfig(async (config, { mergeRsbuildConfig }) => {
|
|
39
|
-
const isNewJsx = await (0,
|
|
40
|
+
const isNewJsx = await (0, import_plugin_react.isBeyondReact17)(api.context.rootPath);
|
|
40
41
|
const babelConfig = {
|
|
41
42
|
tools: {
|
|
42
43
|
babel(_, { addPresets, addPlugins }) {
|
package/dist/provider.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(provider_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(provider_exports);
|
|
34
34
|
var import_shared = require("@rsbuild/shared");
|
|
35
35
|
var import_server = require("@rsbuild/core/server");
|
|
36
|
+
var import_rspack_provider = require("@rsbuild/core/rspack-provider");
|
|
36
37
|
var import_createContext = require("./core/createContext");
|
|
37
38
|
var import_plugin = require("./shared/plugin");
|
|
38
39
|
var import_initConfigs = require("./core/initConfigs");
|
|
@@ -48,7 +49,7 @@ function webpackProvider({
|
|
|
48
49
|
return {
|
|
49
50
|
bundler: "webpack",
|
|
50
51
|
pluginAPI,
|
|
51
|
-
publicContext: (0,
|
|
52
|
+
publicContext: (0, import_rspack_provider.createPublicContext)(context),
|
|
52
53
|
async applyDefaultPlugins() {
|
|
53
54
|
pluginStore.addPlugins(await (0, import_plugin.applyDefaultPlugins)(plugins));
|
|
54
55
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
"ts-loader": "9.4.4",
|
|
52
52
|
"tsconfig-paths-webpack-plugin": "4.1.0",
|
|
53
53
|
"webpack": "^5.89.0",
|
|
54
|
-
"@rsbuild/babel-preset": "0.0.
|
|
55
|
-
"@rsbuild/core": "0.0.
|
|
56
|
-
"@rsbuild/plugin-babel": "0.0.
|
|
57
|
-
"@rsbuild/plugin-
|
|
58
|
-
"@rsbuild/
|
|
54
|
+
"@rsbuild/babel-preset": "0.0.26",
|
|
55
|
+
"@rsbuild/core": "0.0.26",
|
|
56
|
+
"@rsbuild/plugin-babel": "0.0.26",
|
|
57
|
+
"@rsbuild/plugin-react": "0.0.26",
|
|
58
|
+
"@rsbuild/plugin-css-minimizer": "0.0.26",
|
|
59
|
+
"@rsbuild/shared": "0.0.26"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@types/lodash": "^4.14.200",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"react": "^18.2.0",
|
|
64
65
|
"react-dom": "^18.2.0",
|
|
65
66
|
"typescript": "^5.2.2",
|
|
66
|
-
"@rsbuild/test-helper": "0.0.
|
|
67
|
+
"@rsbuild/test-helper": "0.0.26"
|
|
67
68
|
},
|
|
68
69
|
"engines": {
|
|
69
70
|
"node": ">=14.0.0"
|