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:
- Install the plug-in found in our node_module;
- In gruntfile.js, load the installed plugin tasks through grunt's loadNpmTasks;
- Add some options for this configuration in grunt's initConfig;
- This way the plugin can work normally