P
P
Programep2017-05-13 16:02:15
JavaScript
Programep, 2017-05-13 16:02:15

How to set up grunt js correctly?

Good afternoon! I work on Windows 7.
Questions, I think, are simple, but I'm just getting started with this:
1. Is the order in which grunt is installed on the system correct?
After installing nodejs, I ran nodejs command promt and ran the command:
npm install -g grunt-cli
2. Is the order in which grunt is installed in the project correct?
I open the nodejs command promt window and execute the commands:

mkdir grunt_test
cd grunt_test
npm init
npm install grunt --save-dev

3. Does Gruntfile.js need to be created manually in each project or is there a command to create a template file, similar to how after running the "npm init" command, the "package.json" file is created?
4. Should it be created in the same directory as "package.json"?
In the initial guide, I found only an example of the contents of this file An example Gruntfile , but I didn’t understand where it should be.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeniy Odinets, 2017-05-13
@Programep

I would advise you to look towards webpack or gulp.

Is the order in which grunt is installed in the project correct?
What a stupid question? You've created a directory, moved into it, and added grunt to package.json. Everything is correct.
Does Gruntfile.js need to be created manually in each project or is there a command to create a template file, similar to how after running the "npm init" command, the "package.json" file is created?
Of course, in each project you will have different files in different directories and you need to configure everything separately
Should it be created in the same directory as "package.json"?
In which directory to create configs does not really matter, usually they are placed in the root of the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question