Skip to content

Commit

Permalink
feat: enable CLI shortcuts by default when using Rsbuild CLI (#3652)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Oct 8, 2024
1 parent cd4fe07 commit 8cab226
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions examples/react/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ import { pluginReact } from '@rsbuild/plugin-react';

export default defineConfig({
plugins: [pluginReact()],
dev: {
cliShortcuts: true,
},
});
6 changes: 6 additions & 0 deletions packages/core/src/cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ export async function init({
config.server.port = commonOpts.port;
}

// enable CLI shortcuts by default when using Rsbuild CLI
if (config.dev?.cliShortcuts === undefined) {
config.dev ||= {};
config.dev.cliShortcuts = true;
}

return createRsbuild({
cwd: root,
rsbuildConfig: config,
Expand Down

0 comments on commit 8cab226

Please sign in to comment.