[英]Reduce size of grunt with packages on linux. File paths too long for Jenkins
我最近在Linux機器上下載了帶有2個軟件包的grunt。
我遵循的指南: https : //github.com/gruntjs/grunt-contrib-jasmine
我遵循的指南: https : //github.com/maenu/grunt-template-jasmine-istanbul
我發現整個咕unt聲文件夾很大,我想知道是否有任何方法可以縮小它。 我在頂層node_modules文件夾中有以下軟件包:grunt,grunt-contrib-jasmine和grunt-template-jasmine-Istanbul。 我曾嘗試刪除我認為是多余的文件,但似乎大多數庫即使重復也需要。
我將把我的GruntFile貼出來,將對您有幫助:
module.exports = function(grunt) {
grunt.initConfig({
jasmine: {
coverage: {
src: 'src/*.js',
options: {
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js',
vendor: ['lib/jquery.js', 'lib/angular.js', 'lib/angular-touch.js', 'lib/angular-route.js', 'lib/angular-cookies.js',
'lib/ui-bootstrap.js', 'lib/jasmine-jquery.js', 'lib/angular-mocks.js'],
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/coverage.json',
report: {
type: 'cobertura',
options: {
dir: 'coverage/cobertura'
}
},
thresholds: {
lines: 50,
statements: 50,
branches: 50,
functions: 50
}
}
}
}
}
});
// Register tasks.
grunt.loadNpmTasks('grunt-contrib-jasmine');
// Default task.
grunt.registerTask('default', 'jasmine');
};
任何幫助表示贊賞。
編輯:由於重復的node_modules文件路徑太長,不允許詹金斯建立。
我解決此問題的方法是在安裝軟件包時使用npmd的--greedy標志而不是npm。
Npmd: https : //github.com/dominictarr/npmd
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.