zoukankan      html  css  js  c++  java
  • grunt打包工具使用

    package.json

    {
    "name": "**",
    "version": "0.1.0",
    "author": "Amanda",
    "description": "**",
    "dependencies": {
    "grunt": "*",
    "grunt-contrib-clean": "*",
    "grunt-contrib-compress": "*",
    "grunt-contrib-copy": "*",
    "grunt-contrib-cssmin": "*",
    "grunt-contrib-htmlmin": "*",
    "grunt-contrib-uglify": "*",
    "grunt-strip-debug": "^1.1.0"
    },
    "devDependencies": {
    "gulp": "^3.9.1"
    }

    Gruntfile.js

    module.exports = function (grunt) {
    grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    stripDebug: {
    dist: {
    files: {
    '***.js': '***.js'
    }
    }
    },
    uglify: {
    scripts: {
    files: {
    '**.min.js':'**.js'

    }
    }
    }

    });


    grunt.loadNpmTasks('grunt-strip-debug');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.registerTask('default', ['stripDebug','uglify']);

    };

    命令:

    npm install -g grunt-cli

    npm install

    gulp

  • 相关阅读:
    ant
    hudson
    【消息队列MQ】各类MQ比较
    日本出行
    使用Eclipse Installer安装Eclipse
    Firebug控制台详解
    浮动
    CSS3
    HTML制作视频简介
    使用I/O流复制指定文件
  • 原文地址:https://www.cnblogs.com/amandaff/p/7910019.html
Copyright © 2011-2022 走看看