Basic steps to complete the project with Grunt

Use Grunt to complete the basic build of the project

First use the newly created file to store our Grunt

mkdir grunt-sample

Then switch to the current directory

cd grunt-sample

Continue we have to initialize my package.json file in our folder

yarn init --yes

Install the grunt module we used again (wait a moment)

yarn add grunt

Create a new gruntfile.js file in the current directory for (grunt entry file)

There are several main steps to use grunt's plugin:

  1. Install the plug-in found in our node_module;
  2. In gruntfile.js, load the installed plugin tasks through grunt's loadNpmTasks;
  3. Add some options for this configuration in grunt's initConfig;
  4. This way the plugin can work normally

Guess you like

Origin blog.csdn.net/weixin_43956521/article/details/107349399