@rsbuild/core 0.0.14 → 0.0.15
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/plugins/html.js +14 -2
- package/package.json +2 -2
package/dist/plugins/html.js
CHANGED
|
@@ -49,10 +49,8 @@ async function getMetaTags(entryName, config) {
|
|
|
49
49
|
}
|
|
50
50
|
async function getTemplateParameters(entryName, config, assetPrefix) {
|
|
51
51
|
const { mountId, templateParameters, templateParametersByEntries } = config.html;
|
|
52
|
-
const title = (0, import_shared.getTitle)(entryName, config);
|
|
53
52
|
const templateParams = (templateParametersByEntries == null ? void 0 : templateParametersByEntries[entryName]) || templateParameters;
|
|
54
53
|
const baseParameters = {
|
|
55
|
-
title,
|
|
56
54
|
mountId,
|
|
57
55
|
entryName,
|
|
58
56
|
assetPrefix
|
|
@@ -131,6 +129,10 @@ const pluginHtml = () => ({
|
|
|
131
129
|
meta: [],
|
|
132
130
|
HtmlPlugin
|
|
133
131
|
};
|
|
132
|
+
const titlePluginOptions = {
|
|
133
|
+
titles: [],
|
|
134
|
+
HtmlPlugin
|
|
135
|
+
};
|
|
134
136
|
await Promise.all(
|
|
135
137
|
entryNames.map(async (entryName, index) => {
|
|
136
138
|
const entryValue = entries[entryName].values();
|
|
@@ -140,6 +142,7 @@ const pluginHtml = () => ({
|
|
|
140
142
|
const filename = htmlPaths[entryName];
|
|
141
143
|
const template = (0, import_shared.getTemplatePath)(entryName, config);
|
|
142
144
|
const metaTags = await getMetaTags(entryName, config);
|
|
145
|
+
const title = await (0, import_shared.getTitle)(entryName, config);
|
|
143
146
|
const templateParameters = await getTemplateParameters(
|
|
144
147
|
entryName,
|
|
145
148
|
config,
|
|
@@ -151,6 +154,12 @@ const pluginHtml = () => ({
|
|
|
151
154
|
filename
|
|
152
155
|
});
|
|
153
156
|
}
|
|
157
|
+
if (title) {
|
|
158
|
+
titlePluginOptions.titles.push({
|
|
159
|
+
title,
|
|
160
|
+
filename
|
|
161
|
+
});
|
|
162
|
+
}
|
|
154
163
|
const pluginOptions = {
|
|
155
164
|
chunks,
|
|
156
165
|
inject,
|
|
@@ -190,6 +199,9 @@ const pluginHtml = () => ({
|
|
|
190
199
|
if (metaPluginOptions.meta.length) {
|
|
191
200
|
chain.plugin(CHAIN_ID.PLUGIN.HTML_META).use(import_shared.HtmlMetaPlugin, [metaPluginOptions]);
|
|
192
201
|
}
|
|
202
|
+
if (titlePluginOptions.titles.length) {
|
|
203
|
+
chain.plugin(CHAIN_ID.PLUGIN.HTML_TITLE).use(import_shared.HtmlTitlePlugin, [titlePluginOptions]);
|
|
204
|
+
}
|
|
193
205
|
if (config.security) {
|
|
194
206
|
const { nonce } = config.security;
|
|
195
207
|
if (nonce) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Unleash the power of Rspack with the out-of-the-box build tool.",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"pkg-up": "^3.1.0",
|
|
75
75
|
"postcss": "8.4.31",
|
|
76
76
|
"semver": "^7.5.4",
|
|
77
|
-
"@rsbuild/shared": "0.0.
|
|
77
|
+
"@rsbuild/shared": "0.0.15"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/lodash": "^4.14.200",
|