LoginSignup
1
1

More than 5 years have passed since last update.

Parseを試してみる 2週目

Last updated at Posted at 2014-07-26

三連休なので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 buildconcatとかがうまくいかないのは、ここが原因だった。
  • 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に移行しようかな…参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1