2. Proficient in the Seajs and Gruntjs of the front-end series Technology (III.)

Source: Internet
Author: User

1. Let's take a look at the modular history

the advent of the Modular History Nodejs (http: // nodejs.org/)COMMONJS specification (http://www.commonjs.org/) browser JS modular? AMD Spec (http:///wiki.commonjs.org/wiki/modules/asynchronousdefinition)Requirejs Library (http:  the requirejs.org/cmd specification Seajs used

We usually develop the front-end when divided into offline and online, offline direct development of debug scripts, and online is a lot of script files merged into a compressed encryption, reduce the HTTP request, this time we need to build tools

2. We begin to understand the build tool installation process

build Tool Gruntjs (http: // gruntjs.com/)  -Ggrunt---save---save-dev

Basic use of 3.gruntjs

build Tool Gruntjs (http: // gruntjs.com/) using the concept of a process plug-in package.jsonGruntfile.js

1.cmd Entering the catalogue

2.NPM Install (Package.json refers to which plugins to download which plugins)

3.gruntfile.js

Module.exports =function (Grunt) {Grunt.initconfig ({Pkg:grunt.file.readJSON ('Package.json'), concat: {webqq: {files: {'Dist/main.js': ['Main.js','Drag.js','Scale.js','Range.js']}}, Uglify: {webqq: {files: { 'Dist/main.min.js': ['Dist/main.js']                  }             }         }            }); Grunt.loadnpmtasks ('Grunt-contrib-concat'); Grunt.loadnpmtasks ('grunt-contrib-uglify'); Grunt.registertask ('default', ['concat','uglify']); };

4. Typing cmd command: Grunt command

SOURCE download

2. Proficient in the Seajs and Gruntjs of the front-end series Technology (III.)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.