[英]Angularjs (Error: $injector:modulerr Module Error) on concatenating bower components?
当我使用grunt串联angularjs(angular&ui-router)的bower_components时,
我收到一个(Error: $injector:modulerr Module Error)
此处完整错误https://goo.gl/0yz6pm
在生成的脚本上。
当我直接从bower_components使用脚本源时,我没有收到此错误
因此,我认为这是一个咕gr串联的问题。
下面是咕unt的脚本,
grunt.initConfig({
concat:{
options: {
},
dist: {
// the files to concatenate
src: ['client/bower_components/angular/angular.min.js','client/bower_components/angular-ui-router/release/angular-ui-router.min.js'],
// the location of the resulting JS file
dest: 'client/bower_components/../assets/scripts/coreScript.js',
nonull: true
}
}
})
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('build',['concat']);
}
我也尝试过使用seperator:';'
options
但没有帮助。
我该怎么做才能在此处进行串联?
假设所有这些脚本引用均正确并且您在页面上引用coreScript.js,则此设置看起来不错。 我在这里看到的唯一问题是您对.registerTask
的调用。 观察您的实施
grunt.registerTask('build','concat']);
但是,咕unt声期待一个任务数组
grunt.registerTask('build', ['concat']); // close array with [
是否可能因为此问题而无法成功运行此任务? 我也没有看到readJSON
的电话。 您还可能在gruntfile.js声明中缺少以下内容吗?
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
// ...
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.