小编Fab*_*Fab的帖子

动态更改任务uglify的配置

我需要根据需要更改我的uglify任务的配置以仅缩小文件(如jshint任务所述:https://github.com/gruntjs/grunt-contrib-watch#compiling-files-as-needed)

修改适用于jshint任务但不适用于uglify,我认为问题是属性路径...

任何帮助,将不胜感激 ;)

这是我的Gruntfile.js:

module.exports = function (grunt) {
    grunt.initConfig({

        // define source files and their destinations
        jshint: {
            all: ['dev/**/*.js'],
        },
        uglify: {
            dynamic_mappings: {
              // Grunt will search for "**/*.js" under "dev/" when the "minify" task
              // runs and build the appropriate src-dest file mappings then, so you
              // don't need to update the Gruntfile when files are added or removed.
            files: [{
                  expand: true,     // Enable dynamic expansion.
                  cwd: 'dev/',      // Src …
Run Code Online (Sandbox Code Playgroud)

gruntjs

8
推荐指数
1
解决办法
3286
查看次数

标签 统计

gruntjs ×1