@rsbuild/core 0.2.4 → 0.2.5
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/cli/commands.js +1 -1
- package/dist/cli/prepare.js +1 -1
- package/dist/plugins/html.js +1 -1
- package/dist/provider/core/createContext.js +1 -1
- package/dist/provider/plugins/sass.js +1 -0
- package/dist/rspack/HtmlAppIconPlugin.js +4 -7
- package/dist/rspack/HtmlBasicPlugin.d.ts +0 -1
- package/dist/rspack/HtmlBasicPlugin.js +2 -3
- package/package.json +2 -2
package/dist/cli/commands.js
CHANGED
|
@@ -83,7 +83,7 @@ async function init({
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
function runCli() {
|
|
86
|
-
import_commander.program.name("rsbuild").usage("<command> [options]").version("0.2.
|
|
86
|
+
import_commander.program.name("rsbuild").usage("<command> [options]").version("0.2.5");
|
|
87
87
|
import_commander.program.command("dev").option("--open", "open the page in browser on startup").option(
|
|
88
88
|
"--port <port>",
|
|
89
89
|
"specify a port number for Rsbuild Server to listen"
|
package/dist/cli/prepare.js
CHANGED
|
@@ -34,7 +34,7 @@ function prepareCli() {
|
|
|
34
34
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js")) {
|
|
35
35
|
console.log();
|
|
36
36
|
}
|
|
37
|
-
import_rslog.logger.greet(` ${`Rsbuild v${"0.2.
|
|
37
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"0.2.5"}`}
|
|
38
38
|
`);
|
|
39
39
|
}
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/plugins/html.js
CHANGED
|
@@ -59,7 +59,7 @@ function createContextByConfig(options, bundlerType, config = {}) {
|
|
|
59
59
|
const context = {
|
|
60
60
|
entry: config.source?.entry || getDefaultEntry(rootPath),
|
|
61
61
|
targets: config.output?.targets || [],
|
|
62
|
-
version: "0.2.
|
|
62
|
+
version: "0.2.5",
|
|
63
63
|
rootPath,
|
|
64
64
|
distPath,
|
|
65
65
|
cachePath,
|
|
@@ -45,6 +45,7 @@ function pluginSass() {
|
|
|
45
45
|
const { excludes, options } = (0, import_shared.getSassLoaderOptions)(
|
|
46
46
|
config.tools.sass,
|
|
47
47
|
// source-maps required for loaders preceding resolve-url-loader
|
|
48
|
+
// otherwise the resolve-url-loader will throw an error
|
|
48
49
|
true
|
|
49
50
|
);
|
|
50
51
|
const rule = chain.module.rule(utils.CHAIN_ID.RULE.SASS).test(import_shared.SASS_REGEX);
|
|
@@ -32,7 +32,7 @@ __export(HtmlAppIconPlugin_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(HtmlAppIconPlugin_exports);
|
|
34
34
|
var import_fs = __toESM(require("fs"));
|
|
35
|
-
var import_path =
|
|
35
|
+
var import_path = require("path");
|
|
36
36
|
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"));
|
|
37
37
|
var import_webpack_sources = __toESM(require("@rsbuild/shared/webpack-sources"));
|
|
38
38
|
var import_shared = require("@rsbuild/shared");
|
|
@@ -48,22 +48,19 @@ class HtmlAppIconPlugin {
|
|
|
48
48
|
`[${this.name}] Can not find the app icon, please check if the '${this.iconPath}' file exists'.`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
const iconRelativePath = import_path.
|
|
52
|
-
this.distDir,
|
|
53
|
-
import_path.default.basename(this.iconPath)
|
|
54
|
-
);
|
|
51
|
+
const iconRelativePath = import_path.posix.join(this.distDir, (0, import_path.basename)(this.iconPath));
|
|
55
52
|
compiler.hooks.compilation.tap(this.name, (compilation) => {
|
|
56
53
|
import_html_webpack_plugin.default.getHooks(compilation).alterAssetTagGroups.tap(
|
|
57
54
|
this.name,
|
|
58
55
|
(data) => {
|
|
59
|
-
const
|
|
56
|
+
const publicPath = (0, import_shared.getPublicPathFromCompiler)(compiler);
|
|
60
57
|
data.headTags.unshift({
|
|
61
58
|
tagName: "link",
|
|
62
59
|
voidTag: true,
|
|
63
60
|
attributes: {
|
|
64
61
|
rel: "apple-touch-icon",
|
|
65
62
|
sizes: "180*180",
|
|
66
|
-
href:
|
|
63
|
+
href: (0, import_shared.withPublicPath)(iconRelativePath, publicPath)
|
|
67
64
|
},
|
|
68
65
|
meta: {}
|
|
69
66
|
});
|
|
@@ -40,8 +40,7 @@ class HtmlBasicPlugin {
|
|
|
40
40
|
this.options = options;
|
|
41
41
|
}
|
|
42
42
|
apply(compiler) {
|
|
43
|
-
const addTitleTag = (headTags,
|
|
44
|
-
const { title } = this.options.info[entryName];
|
|
43
|
+
const addTitleTag = (headTags, title) => {
|
|
45
44
|
if (title) {
|
|
46
45
|
headTags.unshift({
|
|
47
46
|
tagName: "title",
|
|
@@ -77,7 +76,7 @@ class HtmlBasicPlugin {
|
|
|
77
76
|
const { headTags } = data;
|
|
78
77
|
const { templateContent } = this.options.info[entryName];
|
|
79
78
|
if (!hasTitle(templateContent)) {
|
|
80
|
-
addTitleTag(headTags,
|
|
79
|
+
addTitleTag(headTags, data.plugin.options?.title);
|
|
81
80
|
}
|
|
82
81
|
addFavicon(headTags, entryName);
|
|
83
82
|
return data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
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": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"core-js": "~3.32.2",
|
|
61
61
|
"html-webpack-plugin": "npm:html-rspack-plugin@5.5.7",
|
|
62
62
|
"postcss": "8.4.31",
|
|
63
|
-
"@rsbuild/shared": "0.2.
|
|
63
|
+
"@rsbuild/shared": "0.2.5"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "16.x",
|