Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/core/src/plugins/appIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type IconExtra = {
);

export const pluginAppIcon = (): RsbuildPlugin => ({
name: 'rsbuild:app-icon',
name: 'rsbuild:appIcon',

setup(api) {
const htmlTagsMap = new Map<string, HtmlBasicTag[]>();
Expand Down Expand Up @@ -103,7 +103,7 @@ export const pluginAppIcon = (): RsbuildPlugin => ({
if (icon.target === 'web-app-manifest' && !appIcon.name) {
addCompilationError(
compilation,
`${color.dim('[rsbuild:app-icon]')} ${color.yellow(
`${color.dim('[rsbuild:appIcon]')} ${color.yellow(
'"appIcon.name"',
)} is required when ${color.yellow('"target"')} is ${color.yellow(
'"web-app-manifest"',
Expand All @@ -116,7 +116,7 @@ export const pluginAppIcon = (): RsbuildPlugin => ({
if (!compilation.inputFileSystem) {
addCompilationError(
compilation,
`${color.dim('[rsbuild:app-icon]')} Failed to read the icon file as ${color.yellow(
`${color.dim('[rsbuild:appIcon]')} Failed to read the icon file as ${color.yellow(
'"compilation.inputFileSystem"',
)} is not available.`,
);
Expand All @@ -128,7 +128,7 @@ export const pluginAppIcon = (): RsbuildPlugin => ({
) {
addCompilationError(
compilation,
`${color.dim('[rsbuild:app-icon]')} Failed to find the icon file at ${color.yellow(
`${color.dim('[rsbuild:appIcon]')} Failed to find the icon file at ${color.yellow(
icon.absolutePath,
)}.`,
);
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/plugins/cleanOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ export const pluginCleanOutput = (): RsbuildPlugin => ({

// Use `for...of` to handle nested directories correctly
for (const pathInfo of pathInfos) {
// Users may mistakenly set `output.distPath.root` to '/'
if (pathInfo.path === '/') {
const prefix = color.dim('[rsbuild:cleanOutput]');
throw new Error(
`${prefix} Refusing to clean output at ${color.cyan(
`"${pathInfo.path}"`,
)}. Update ${color.yellow(
'`output.distPath.root`',
)} or set ${color.yellow('`output.cleanDistPath`')} to false.`,
);
}
await emptyDir(pathInfo.path, pathInfo.keep);
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/plugins/nodeAddons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const pluginNodeAddons = (): RsbuildPlugin => ({

if (filename === null) {
throw new Error(
`${color.dim('[rsbuild:node-addons]')} Failed to load Node.js addon: ${color.yellow(resourcePath)}`,
`${color.dim('[rsbuild:nodeAddons]')} Failed to load Node.js addon: ${color.yellow(resourcePath)}`,
);
}

Expand Down
Loading