我如何告诉咕噜为NOT运行如下或构建任务串联js文件? [英] How do I tell Grunt to NOT minify or concatenate js files in a build task?
问题描述
我已经使用约曼只是脚手架的角度应用程序。我注意到,在建立
任务的默认操作一些事情,包括缩小文件和连接js文件。
I've just scaffolded an Angular app using Yeoman. I've noticed that the build
task does several things by default, including minifying and concatenating js files.
我想有一个简单的构建任务没做任何缩小文件或连接,相反,只有做了以下两件事情:
I'd like to have a simpler build task that didn't do any minifying or concatenation, and, instead, only did the following two things:
- 编译我.scss到的.css
- 复制工作程序到我的分发目录
谁能帮我写一个咕噜任务,将做头(只)这两件事情?
Can anyone help me write a grunt task that will do (only) these two things?
非常感谢。
推荐答案
好吧,我编辑了默认的呼噜声文件,以便我想要做什么。
Ok, I've edited the default grunt file so that it does what I want.
叫我的解决方案参与写作任务复制:devDist
和罗盘:devDist
,然后将它们组合成一个 devDist
任务。
My solution involved writing tasks called copy:devDist
and compass:devDist
, and then combining them into a devDist
task.
//
// copy:devDist --> copies everything into the dist folder, except styles/
//
copy: {
[...]
devDist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'**','!styles/**' // everything but styles/
]
}]
}
},
//
// compass:devDist --> compile the sass; put result in dist/styles/
//
compass: {
[...]
devDist: {
options: {
cssDir: '<%= yeoman.dist %>/styles'
}
}
},
//
// register a 'devDist' task that calls the two tasks above
//
grunt.registerTask('devDist', [
'clean:dist',
'copy:devDist',
'compass:devDist'
]);
现在运行咕噜devDist
编译我的CSS,并提出一个全功能的应用程序到我的DIST文件夹中。优秀。 :)
Now running grunt devDist
compiles my css and puts a fully functional app into my dist folder. Excellent. :)
这篇关于我如何告诉咕噜为NOT运行如下或构建任务串联js文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!