2017-02-09 47 views
0

我试图在SAPUi5应用程序中生成Component-preload.js文件。我正在使用grunt-openui5插件。Component-preload.js not beeing created

我能够生成Component-preload.js,如果我将选项的压缩参数设置为false。如果我将该参数设置为true,则会生成Component-prelaod.js文件。 可能是什么原因?我希望Component-preload.js被缩小。 这里是我使用的Gruntfile.js中的snipplet。

openui5_preload: { 
webapp: { 
options: { 
resources: { 
        cwd: '<%= webapp.srcRoot %>', // this should point to the entry folder 
        prefix: '<%= webapp.prefix %>', // this should be your component namespace 
        src: [ 
         "!Component-preload.js", 
         "**/*.js", 
         "**/*.xml", 
         "*/*.js", 
         "*/*.xml", 
         "*.js", 
         "*.xml", 
         "**/*.properties", 
         "model/*.json", 
         "*.json", 
         "*.js", 
         "**/*.css", 
         "!Gruntfile.js" 
        ], 
       }, 

       // "dest" needs to be defined within "options" not "options.resources" 
       dest: "<%= webapp.targetRoot %>", // to put the file in the same folder 
       compress: true 
      }, 
      components: true 
     } 
    }, 

回答

0

我发现了这个问题。

我的路径中有一些损坏的JavaScript文件,它阻止压缩任务创建文件。 不幸的是,版本0.7.0中的grunt-openui5插件没有显示任何错误消息。我使用插件的版本0.11.0,然后找到导致问题的文件。