@unpackjs/plugin-react 1.6.4 → 1.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/mpa.cjs +2 -3
- package/dist/mpa.d.ts.map +1 -1
- package/dist/mpa.js +3 -3
- package/package.json +4 -5
package/dist/mpa.cjs
CHANGED
|
@@ -33,7 +33,6 @@ module.exports = __toCommonJS(mpa_exports);
|
|
|
33
33
|
var import_node_fs = __toESM(require("node:fs"));
|
|
34
34
|
var import_node_path = __toESM(require("node:path"));
|
|
35
35
|
var import_core = require("@unpackjs/core");
|
|
36
|
-
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
|
|
37
36
|
const addMpaSupport = ({
|
|
38
37
|
config,
|
|
39
38
|
unpackConfig,
|
|
@@ -115,7 +114,7 @@ ${renderer}
|
|
|
115
114
|
}
|
|
116
115
|
html2.push({
|
|
117
116
|
template: unpackConfig.html?.template || "",
|
|
118
|
-
templateContent: unpackConfig.html?.templateContent || import_core.TEMPLATE_CONTENT,
|
|
117
|
+
templateContent: unpackConfig.html?.templateContent || !unpackConfig.html?.template && import_core.TEMPLATE_CONTENT,
|
|
119
118
|
minify: false,
|
|
120
119
|
filename: `${entryName}.html`,
|
|
121
120
|
chunks: [entryName],
|
|
@@ -138,7 +137,7 @@ ${renderer}
|
|
|
138
137
|
const { entry, html } = collectEntry();
|
|
139
138
|
config = mergeConfig(config, {
|
|
140
139
|
entry: createTempFile(entry),
|
|
141
|
-
plugins: html.map((h) => new
|
|
140
|
+
plugins: html.map((h) => new import_core.HtmlPlugin(h))
|
|
142
141
|
});
|
|
143
142
|
return config;
|
|
144
143
|
};
|
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,
|
|
1
|
+
{"version":3,"file":"mpa.d.ts","sourceRoot":"","sources":["../src/mpa.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EAIzB,KAAK,YAAY,EAOlB,MAAM,gBAAgB,CAAA;AAYvB,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,oBA2GH,CAAA"}
|
package/dist/mpa.js
CHANGED
|
@@ -10,6 +10,7 @@ var __filename = /* @__PURE__ */ getFilename();
|
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import path2 from "node:path";
|
|
12
12
|
import {
|
|
13
|
+
HtmlPlugin,
|
|
13
14
|
TEMPLATE_CONTENT,
|
|
14
15
|
TEMP_DIR,
|
|
15
16
|
colors,
|
|
@@ -19,7 +20,6 @@ import {
|
|
|
19
20
|
isPlainObject,
|
|
20
21
|
logger
|
|
21
22
|
} from "@unpackjs/core";
|
|
22
|
-
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
23
23
|
const addMpaSupport = ({
|
|
24
24
|
config,
|
|
25
25
|
unpackConfig,
|
|
@@ -101,7 +101,7 @@ ${renderer}
|
|
|
101
101
|
}
|
|
102
102
|
html2.push({
|
|
103
103
|
template: unpackConfig.html?.template || "",
|
|
104
|
-
templateContent: unpackConfig.html?.templateContent || TEMPLATE_CONTENT,
|
|
104
|
+
templateContent: unpackConfig.html?.templateContent || !unpackConfig.html?.template && TEMPLATE_CONTENT,
|
|
105
105
|
minify: false,
|
|
106
106
|
filename: `${entryName}.html`,
|
|
107
107
|
chunks: [entryName],
|
|
@@ -124,7 +124,7 @@ ${renderer}
|
|
|
124
124
|
const { entry, html } = collectEntry();
|
|
125
125
|
config = mergeConfig(config, {
|
|
126
126
|
entry: createTempFile(entry),
|
|
127
|
-
plugins: html.map((h) => new
|
|
127
|
+
plugins: html.map((h) => new HtmlPlugin(h))
|
|
128
128
|
});
|
|
129
129
|
return config;
|
|
130
130
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/plugin-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,14 +28,13 @@
|
|
|
28
28
|
"@babel/plugin-transform-class-properties": "7.25.9",
|
|
29
29
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
|
|
30
30
|
"@rspack/plugin-react-refresh": "1.0.0",
|
|
31
|
-
"@swc/core": "1.9.
|
|
32
|
-
"@swc/helpers": "0.5.
|
|
31
|
+
"@swc/core": "1.9.2",
|
|
32
|
+
"@swc/helpers": "0.5.15",
|
|
33
33
|
"babel-plugin-react-compiler": "latest",
|
|
34
|
-
"html-webpack-plugin": "5.6.3",
|
|
35
34
|
"launch-editor": "2.9.1",
|
|
36
35
|
"react-refresh": "0.14.2",
|
|
37
36
|
"swc-loader": "0.2.6",
|
|
38
|
-
"@unpackjs/core": "^1.
|
|
37
|
+
"@unpackjs/core": "^1.7.0"
|
|
39
38
|
},
|
|
40
39
|
"scripts": {
|
|
41
40
|
"dev": "modern build --watch",
|