1. After installing the Nodejs, the general will also install NPM, Nodejs integrated NPM, you can do node-v and npm-v in cmd to view their version number, if the display can be described to continue the following actions2. To install grunt, you can normally perform NPM install grunt grunt-cli directly inside CMD, which means installing [install global [-G]
Article Introduction: I heard earlier that Nodejs and grunt are very powerful, especially used to build automated front-end development, but also powerful and incomparable. But has been due to their own mastery of the technology is limited, dare not in-depth, and never go down. Recently in the beginning of learning sass, but also slowly contact this aspect of things. In order to better enable the SASS project to automate the compilation, intends to us
Grunt is the building tool for the JavaScript world.Why use build tools?Word: Automation. For tasks that require repeated repetition, such as compression (Minification), compilation, unit testing, linting, and so on. Automated tools can ease your labor and simplify your work. When you properly configure the task, the task runner will help you do most of the boring work automatically.Why use Grunt?The
confusing.Jpegtran/jpegoptim/optipng/pngout Of course is the ideal compression tool, but the operation is not very convenient, and there are cross-platform problems. But with grunt.js, we can use its plug-in Grunt-contrib-imagemin,imagemin package jpegtran/optipng function, can be batch, lossless compression image size.If you do not understand grunt.js, you can see my last brief introduction.Installing the Imagemin pluginSwitch to the project folder,
Install Grunt on Mac, and install grunt on mac
Step 1: Install brew
Go to http://bremongosh/ brewhome and install the command.
Step 2: Install node
After the installation is successful, enter brew install node in the command line.
Step 3: Install grunt
After the installation is complete, enter npm install-g grunt
During the development of JavaScript, you often encounter repetitive tasks such as merging files, compressing code, checking syntax errors, converting SASS code into CSS code, and so on. Usually, we need to use different tools to accomplish different tasks, both repetitive labor and time-consuming. Grunt is a tool invented to solve this problem and can help us automate the management and operation of various tasks.
Simply put,
What is itThis is a tool that helps front-end development engineers combine tiles from CSS code into sprite diagrams, and its main functions are:
Using the two-tree arrangement algorithm, the CSS file is processed, the slice sequence is collected, and the sprite graph is generated.
Add the Background-position property to the slice in the original CSS code
Generate HD Sprite for HD devices and append media query code at the end of the CSS file
Timestamp the location where the
jquery in the use of grunt,bootstrap in the use of grunt, Baidu Ueditor in the use of grunt, you have no reason not to learn, do not!1. PrefaceEveryone web front-end developers, if you do not know grunt or heard, but not skilled use of grunt, then you really really really ou
jquery in the use of grunt,bootstrap in the use of grunt, Baidu Ueditor in the use of grunt, you have no reason not to learn, do not!1. PrefaceEveryone web front-end developers, if you do not know grunt or heard, but not skilled use of grunt, then you really really really ou
Nicolas Bevacqua A task of comparing the JavaScript build (Yi) system. He compared the Big Three: Grunt, Gulp and NPM, and discussed the pros and cons of each.by Nicolas BevacquaIt is always difficult to decide which technology to use. Once you encounter a problem, you don't want to overturn your previous choice. But you have to choose one, and then let it follow your thoughts. The same is true for a set of constructs (Yi), and you should think of it
1. PrefaceEveryone web front-end developers, if you do not know grunt or heard, but not skilled use of grunt, then you really really really out (three "true" repetition, to show the focus). As for the role of grunt, here is not detailed, in short, if you do Web front-end development, you must use grunt. Also, it is com
Not long ago I wrote an application R. JS to optimize your front-end articles and introduce R. JS is a utility that can compress, merge front-end files, and package the entire project. However. when Javascript is put into the project, we have to take into account a problem. Every time the project is maintained, the maintenance personnel enter the RJS running password and re-package the project. This is naturally very cumbersome. In addition, if we use sass to write styles for our project, we may
Grunt-javascript task runner for the front-end development environmentObjective:1.sass compiled as a CSS file, the previous time to write CSS, later looked at sass very good, so in the new project began to use the sass.The original method:① Installing Ruby② compiling the Sass file (Eg:style)Sass Style.scss Style.css③ Monitor File/folder changes to automatically compile Sass filesSass--watch Style.scss:style.css #fileSass--watch Cssfilepath #directory
ArticleYou can also find it on my GitHub to make the layout more friendly: grunt from getting started to custom project templates 1. Introduction to grunt 1. Grunt is a magic horse
Task-based command line build tool (for JavaScript Projects)
Link: http://gruntjs.com/ 2. Reasons for using GRUNT
Front-end tools are q
1. You have to install Node,window under the executable installation package, very simple.
2. Run command: NPM install-g grunt-cli (-G for global installation, can run in any directory) to install the Grunt command-line interface (CLI). Note that installing GRUNT-CLI is not equivalent to installing the Grunt T
Through the previous front-end development artifact webstorm--Automation Workflow (preface), I believe everyone grunt automation tools have a preliminary understanding. Next I'll use the WROC3000 Web as a prototype to demonstrate how to work with the grunt toolIncrease Productivity,compress code to the maximum extent。1. First install the node environment into the official website to download the installatio
Project One: Grunt-livereload + Chrome Plug-in
Advantages: Installation, configuration is simple and convenient.Disadvantages: Need to cooperate with the specified browser plugin (Firefox also has related plug-ins, ie you know).
1. Need to install 2 connectors: Grunt-contrib-watch, Connect-livereload
To execute a command:
Copy Code code as follows:
NPM Install--save-dev
Grunt-contib-imagemin is a nodejs based plug-in for lossless image compression. The entire grunt-contib-imagemin is made up of a number of widgets, such as Java jar packages, the following four plug-ins are its core components (Linux Toolkit, written in C):1, gifsicle-compress GIF images, corresponding to the Nodejs plug-in gifsicle2, jpegtran-compress JPEG images, corresponding Nodejs plug-in Imagemin-jpeg
1. Before learning grunt, you must first have a simple understanding of nodejs. The steps for installing nodejs are simple. Install nodejs as prompted on the official website. Http://www.nodejs.org/
2. Grunt Introduction
Grunt is an automated project building tool. if you need to repeatedly execute tasks such as compression, compilation, unit testing, code chec
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.