zoukankan      html  css  js  c++  java
  • grunt操作之Gruntfile.js

    Gruntfile.js三种写作方式

    ++注:我们将以grunt中的copy命令举例++
    1. src和desk模式(采用不同任务来执行操作)

     copy:{
                build-1:{
                    src:'<%= config.src %>/index.html',
                    dest:'<%= config.app %>/index.html'
                },
                 build-2:{
                    src:'<%= config.src %>/js/index.js',
                    dest:'<%= config.app %>/js/index.js'
                }
            }
    

    2. files数组模式(采用files数组模式定义不同的src和dest对象)

    copy:{
                build:{
                	files:[
                    	{
                        	src:'<%= config.src %>/index.html',
                    		dest:'<%= config.app %>/index.html'
                        },
                    	{
                        	src:'<%= config.src %>/js/index.js',
                    		dest:'<%= config.app %>/js/index.js'
                        }
                    ]
                }
            }
    

    3. files对象模式(采用files对象模式定义不同的src和dest属性)

    copy:{
            build:{
              files:{
                  '<%= config.app %>/index.html':'<%= config.src %>/index.html',
                  '<%= config.app %>/js/index.js’:'<%= config.src %>/js/index.js'
                   }
    			}
            }
    
  • 相关阅读:
    pycharm过期后,修改hosts文件?
    三种格式化方式
    virtualenv安装及使用
    二分查找以及单例模式
    目录总览
    SQLAlchemy
    Redis
    linux 安装虚拟机
    shell基本命令
    Linux 命令大全
  • 原文地址:https://www.cnblogs.com/reamd/p/4927636.html
Copyright © 2011-2022 走看看