首页 > grunt-contrib-requirejs 开发环境和deploy环境配置

grunt-contrib-requirejs 开发环境和deploy环境配置

deploy版本所有的模块都打包混淆在一个view.min.js了
"build":{

         "options":{
             "baseUrl":"./js",
             "name":"viewer",
             "optimize": "uglify",
             "mainConfigFile":"./js/viewer.js",
             "out":"../js/viewer.min.js",
             "findNestedDependencies": true,
             "paths":{
                "header":'widget/header',
                "attach":'widget/attach',
                "content":'widget/content',
                "loading":'widget/loading',
                "tool":"tool/tool"
            }
         }
     }

但是开发版本不想引入这个混淆压缩后的viewer.js 而是想用直观的源码 即viewer.js header.js attach.js content.js tool.js 但是又不想用require.config 来path和map 因为这样viewer.html就会多出类似这样的:
require.config({

    paths:{
        header:'../../components/header/header',
        attach:'../../components/attach/attach',
        iframe:'../../components/iframe/iframe',
        loading:'../../components/loading/loading',
        mailData:path+"/mail"
    }

});
但是deploy版本的viewer.html不需要上面的这段map 每次手工删除会很麻烦
不知道大家有没有遇到这样的问题 不知道我有没有说清楚被大家理解

【热门文章】
【热门文章】