三連休なのでParseを試してみる で周辺環境の準備でParse自体をあまり三連休中にいじれなかったので、その続き。
随時更新中。
4日目
もう一度Gruntの復習
いまのbuildタスクの中身
grunt.registerTask "build", [
"clean:dist"
"wiredep"
"jade"
"useminPrepare"
"concurrent:dist"
"autoprefixer"
"concat"
"ngmin"
"copy:dist"
"cdnify"
"cssmin"
"uglify"
"filerev"
"usemin"
"htmlmin"
]
-
wiredepってなんだ -> bower.jsonに書いてある必要なコンポーネント(dep = dependencies)をindex.jadeの
// bower:js
から// endbower
の間にscript
タグで突っ込んでくれるやつ - useminPrepareは?
useminPrepare task updates the grunt configuration to apply a configured transformation flow to tagged files (i.e. blocks). By default the transformation flow is composed of concat and uglifyjs for JS files, but it can be configured.
- htmlを解析して、その後のconcatとかuglifyとか用の設定を作るっぽい。
- jade使うようにしてから、
grunt build
でconcat
とかがうまくいかないのは、ここが原因だった。 - Short Circuits: Using Jade templates with Yeomanの6に書いてあった。
By default, it’s going to look for those scripts in the same location as the index.html file it’s parsing, which is going to be .tmp in our case. Since all our files are actually still in /app, we need to indicate this to usemin. So, anywhere you have a usemin block that refers to files in /app, indcate it with (app).
html2jadeで変換した際にインデントがおかしくなっているコメントがあって、そのせいで
useminPrepare
でconfigの作成ができていなかった。concurrent
は? ->concurrent:dist
に定義されてる複数のタスク"copy:styles"
,"imagemin"
,"svgmin"
を高速化のために並列実行するよ、っていうだけ。gruntがやっぱりややこしいので、gulpに移行しようかな…参考