LoginSignup
0
0

More than 5 years have passed since last update.

syntax errorが出てもwebpackからエラーが帰ってこない

Last updated at Posted at 2015-05-27
  gulp.task "scripts:compile", [], ->
    conf = require "#{paths.root}/gulp.d/webpack.conf.coffee"
    gulp
    .src "#{paths.src}/bundle/index.coffee"
    .pipe(webpack(conf, null, (err, stat) ->
      console.log err if err
    )).pipe gulp.dest "#{paths.dest}"

これでindex.coffeeにめちゃめちゃな文字を書いても err == null で帰ってくる。コマンドラインで

./node_modules/.bin/webpack --config=./gulp.d/webpack.conf.coffee       

するとちゃんとエラーが表示されるのでどうなってるんだとコード見たら stats.hash も見ないとダメだそうです。そんなのわかんねっす。

https://github.com/webpack/webpack/blob/master/bin/webpack.js#L176-L179

追記

callback書かなければいい感じに表示してくれた

0
0
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
0
0