LoginSignup
1
1

More than 5 years have passed since last update.

Railsのwebpacker:compileでUnexpected token puncを修正する手順

Last updated at Posted at 2017-03-21

🎯ここでのゴール

RailsのWebpackerを使って本番環境むけにwebpacker:compileすると、Unexpected token punc が発生する問題を修正するする。

🔀手順

UglifyJS2#harmonyを追加する

yarn add "git://github.com/mishoo/UglifyJS2#harmony"

webpacker:compileする

./bin/rake webpacker:compile

確認する

cat public/packs/digests.json

このdigests.jsonが生成されていればOK

💚所感

  • UglifyJS2のステーブルブランチがES6に対応していないのは課題。
  • なにもしないでもminifyしたい。
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