May 25, 2021 Grunt
npm install -g grunt-init
grunt-init command.
git clone git://github.com/gruntjs/grunt-init-gruntplugin.git ~/.grunt-init/gruntplugin
template with the git clone command.
grunt-init gruntplugin
npm install
command to prepare the development environment.
npm publish
command to publish the Grunt plug-in you created npm!
The "grunt-contrib" namespace is reserved for task maintained by the Grunt team, give your own task a suitable name, and avoid using the reserved namespace.
Grunt hides error stack traces by default, but can be
--stack
parameter so you can debug your own task. I
f you want Grunt to always record the stack trace in the event of an error, you can create a command alias (alias) in your shell.
For example, in bash, you can create an alias by using the
alias grunt='grunt --stack'
command.
Store the data file only in the .grunt/npm-module-name directory in the root of the project and clear it when appropriate. This is not a good solution for temporary files, and it is recommended that you call the operating system-level temporary directory functionality using several common npm modules listed later, such as temporary, tmp.
process.cwd()
By default, the directory containing the gruntfile file is set to the current working directory.
Users can change the current working directory by
grunt.file.setBase()
changes in their own gruntfile, but the plug-in should not change it.
path.resolve('foo')
to obtain the absolute path of 'foo' relative to the directory in which
Gruntfile
is located.