← 返回命令列表

Linux command

grunt 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run default task

grunt

Run specific task

grunt [task-name]

List available tasks

grunt --help

Run with verbose output

grunt --verbose

Force task completion

grunt --force

Initialize Gruntfile

grunt-init

说明

Grunt is a JavaScript task runner for automating repetitive tasks. It handles minification, compilation, testing, and linting through a plugin ecosystem. The tool reads configuration from Gruntfile.js. It was widely used before npm scripts and newer build tools like Gulp and webpack gained popularity.

参数

-f, --force
Force execution despite warnings.
-v, --verbose
Verbose output.
--no-color
Disable colored output.
--gruntfile _FILE_
Specify Gruntfile.
--help
Display help information.

FAQ

What is the grunt command used for?

Grunt is a JavaScript task runner for automating repetitive tasks. It handles minification, compilation, testing, and linting through a plugin ecosystem. The tool reads configuration from Gruntfile.js. It was widely used before npm scripts and newer build tools like Gulp and webpack gained popularity.

How do I run a basic grunt example?

Run `grunt` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --force do in grunt?

Force execution despite warnings.