@unpackjs/plugin-react 1.5.1 → 1.5.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 +1 -1
- package/dist/index.js +1 -1
- package/dist/mpa.cjs +6 -3
- package/dist/mpa.d.ts +2 -1
- package/dist/mpa.d.ts.map +1 -1
- package/dist/mpa.js +6 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -46,7 +46,7 @@ const pluginReact = (options = {}) => {
|
|
|
46
46
|
if (options.clickToComponent) {
|
|
47
47
|
config = await (0, import_click_to_component.addClickToComponentSupport)({ config, bundler });
|
|
48
48
|
}
|
|
49
|
-
config = (0, import_mpa.addMpaSupport)({ config, unpackConfig });
|
|
49
|
+
config = (0, import_mpa.addMpaSupport)({ config, unpackConfig, mergeConfig });
|
|
50
50
|
const jsExclude = [/node_modules[\\/](?!\.unpack)/];
|
|
51
51
|
const swcLoader = unpackConfig.bundler === "rspack" ? "builtin:swc-loader" : require.resolve("swc-loader");
|
|
52
52
|
const ReactRefreshPlugin = unpackConfig.bundler === "rspack" ? import_plugin_react_refresh.default : import_react_refresh_webpack_plugin.default;
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const pluginReact = (options = {}) => {
|
|
|
22
22
|
if (options.clickToComponent) {
|
|
23
23
|
config = await addClickToComponentSupport({ config, bundler });
|
|
24
24
|
}
|
|
25
|
-
config = addMpaSupport({ config, unpackConfig });
|
|
25
|
+
config = addMpaSupport({ config, unpackConfig, mergeConfig });
|
|
26
26
|
const jsExclude = [/node_modules[\\/](?!\.unpack)/];
|
|
27
27
|
const swcLoader = unpackConfig.bundler === "rspack" ? "builtin:swc-loader" : require.resolve("swc-loader");
|
|
28
28
|
const ReactRefreshPlugin = unpackConfig.bundler === "rspack" ? RspackReactRefreshPlugin : WebpackReactRefreshPlugin;
|
package/dist/mpa.cjs
CHANGED
|
@@ -36,7 +36,8 @@ var import_shared = require("@unpackjs/shared");
|
|
|
36
36
|
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
|
|
37
37
|
const addMpaSupport = ({
|
|
38
38
|
config,
|
|
39
|
-
unpackConfig
|
|
39
|
+
unpackConfig,
|
|
40
|
+
mergeConfig
|
|
40
41
|
}) => {
|
|
41
42
|
if (!unpackConfig.mpa)
|
|
42
43
|
return config;
|
|
@@ -144,8 +145,10 @@ ${renderer}
|
|
|
144
145
|
return { entry: entry2, html: html2 };
|
|
145
146
|
};
|
|
146
147
|
const { entry, html } = collectEntry();
|
|
147
|
-
config
|
|
148
|
-
|
|
148
|
+
config = mergeConfig(config, {
|
|
149
|
+
entry: createTempFile(entry),
|
|
150
|
+
plugins: html.map((h) => new import_html_webpack_plugin.default(h))
|
|
151
|
+
});
|
|
149
152
|
return config;
|
|
150
153
|
};
|
|
151
154
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/mpa.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type BundlerConfiguration, type UnpackConfig } from '@unpackjs/shared';
|
|
2
|
-
export declare const addMpaSupport: ({ config, unpackConfig, }: {
|
|
2
|
+
export declare const addMpaSupport: ({ config, unpackConfig, mergeConfig, }: {
|
|
3
3
|
config: BundlerConfiguration;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
+
mergeConfig: (...configs: BundlerConfiguration[]) => BundlerConfiguration;
|
|
5
6
|
}) => BundlerConfiguration;
|
|
6
7
|
//# sourceMappingURL=mpa.d.ts.map
|
package/dist/mpa.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mpa.d.ts","sourceRoot":"","sources":["../src/mpa.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EAGzB,KAAK,YAAY,EAMlB,MAAM,kBAAkB,CAAA;AAazB,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"mpa.d.ts","sourceRoot":"","sources":["../src/mpa.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EAGzB,KAAK,YAAY,EAMlB,MAAM,kBAAkB,CAAA;AAazB,eAAO,MAAM,aAAa,2CAIvB;IACD,MAAM,EAAE,oBAAoB,CAAA;IAC5B,YAAY,EAAE,YAAY,CAAA;IAC1B,WAAW,EAAE,CAAC,GAAG,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,CAAA;CAC1E,KAAG,oBAoHH,CAAA"}
|
package/dist/mpa.js
CHANGED
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
22
22
|
const addMpaSupport = ({
|
|
23
23
|
config,
|
|
24
|
-
unpackConfig
|
|
24
|
+
unpackConfig,
|
|
25
|
+
mergeConfig
|
|
25
26
|
}) => {
|
|
26
27
|
if (!unpackConfig.mpa)
|
|
27
28
|
return config;
|
|
@@ -129,8 +130,10 @@ ${renderer}
|
|
|
129
130
|
return { entry: entry2, html: html2 };
|
|
130
131
|
};
|
|
131
132
|
const { entry, html } = collectEntry();
|
|
132
|
-
config
|
|
133
|
-
|
|
133
|
+
config = mergeConfig(config, {
|
|
134
|
+
entry: createTempFile(entry),
|
|
135
|
+
plugins: html.map((h) => new HtmlWebpackPlugin(h))
|
|
136
|
+
});
|
|
134
137
|
return config;
|
|
135
138
|
};
|
|
136
139
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/plugin-react",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@swc/helpers": "0.5.13",
|
|
32
32
|
"launch-editor": "2.9.1",
|
|
33
33
|
"html-webpack-plugin": "5.6.0",
|
|
34
|
-
"@unpackjs/shared": "^1.5.
|
|
34
|
+
"@unpackjs/shared": "^1.5.2"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "modern build --watch",
|