工作我目前使用的角度引導色器(https://github.com/buberdds/angular-bootstrap-colorpicker)角度引導取色不精縮版
,當我在本地運行它,它工作正常。但是,當我使用Grunt構建文件時,ColorPicker停止工作。它不會拋出任何錯誤,但當用戶單擊拾色器時它不會執行任何操作。
我附上Gruntfile.js:
// Project configuration.
grunt.initConfig({
connect: {
main: {
options: {
port: 9001
}
}
},
watch: {
main: {
options: {
livereload: true,
livereloadOnError: false,
spawn: false
},
files: [createFolderGlobs(['*.js', '*.less', '*.html']), '!_SpecRunner.html', '!.grunt'],
tasks: [] //all the tasks are run dynamically during the watch event handler
}
},
jshint: {
main: {
options: {
jshintrc: '.jshintrc'
},
src: createFolderGlobs('*.js')
}
},
clean: {
before: {
src: ['dist', 'temp']
},
after: {
src: ['temp']
}
},
less: {
production: {
options: {
},
files: {
'temp/app.css': 'app.less'
}
}
},
ngtemplates: {
main: {
options: {
module: pkg.name,
htmlmin: '<%= htmlmin.main.options %>'
},
src: [createFolderGlobs('*.html'), '!index.html', '!_SpecRunner.html'],
dest: 'temp/templates.js'
}
},
copy: {
main: {
files: [
{ src: ['img/**'], dest: 'dist/' },
{ src: ['bower_components/font-awesome/fonts/**'], dest: 'dist/', filter: 'isFile', expand: true },
{ src: ['bower_components/bootstrap/fonts/**'], dest: 'dist/', filter: 'isFile', expand: true },
{ src: ['deploy.json'], dest: 'dist/', filter: 'isFile', expand: true },
{ src: ['common/font/**'], dest: 'dist/', filter: 'isFile', expand: true }
]
}
},
dom_munger: {
read: {
options: {
read: [
{ selector: 'script[data-concat!="false"]', attribute: 'src', writeto: 'appjs' },
{ selector: 'link[rel="stylesheet"][data-concat!="false"]', attribute: 'href', writeto: 'appcss' }
]
},
src: 'index.html'
},
update: {
options: {
remove: ['script[data-remove!="false"]', 'link[data-remove!="false"]'],
append: [
{ selector: 'body', html: '<script src="app.full.js"></script>' },
{ selector: 'head', html: '<link rel="stylesheet" href="app.full.min.css">' }
]
},
src: 'index.html',
dest: 'dist/index.html'
}
},
cssmin: {
main: {
src: ['temp/app.css', '<%= dom_munger.data.appcss %>'],
dest: 'dist/app.full.min.css'
}
},
concat: {
main: {
src: ['<%= dom_munger.data.appjs %>', '<%= ngtemplates.main.dest %>'],
dest: 'temp/app.full.js'
}
},
ngAnnotate: {
main: {
src: 'temp/app.full.js',
dest: 'dist/app.full.js'
}
},
uglify: {
main: {
src: 'temp/app.full.js',
dest: 'dist/app.full.min.js'
}
},
htmlmin: {
main: {
options: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
},
files: {
'dist/index.html': 'dist/index.html'
}
}
}
任何幫助將不勝感激。謝謝!