Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
webpacker 2からwebpacker 3への移行作業のログ

Webpacker 2 → Webpacker 3 移行ログ


./bin/bundle update webpacker

webpacker npmパッケージをインストール

yarn upgrade @rails/webpacker --latest

webpacker 2設定を削除

rm -rf config/webpack/

webpacker 3設定をインストール

./bin/rails webpacker:install # choose Y all
rm -rf app/javascript/ # ディレクトリデフォルトから変えてるので不要


./bin/bundle config --delete bin
./bin/rails app:update:bin

webpack 3でアプリから直接依存しなくなったモジュールを削除


yarn remove webpack webpack-manifest-plugin extract-text-webpack-plugin compression-webpack-plugin css-loader file-loader glob node-sass js-yaml path-complete-extname coffee-loader coffee-script babel-core babel-loader babel-plugin-syntax-dynamic-import babel-plugin-transform-class-properties babel-plugin-transform-object-rest-spread babel-preset-env prop-types rails-erb-loader postcss-loader resolve-url-loader sass-loader style-loader


  • .postcssrc.yml修正(cssnextとsmart-importははずして、autoprefixerのみに変更)
  • ts-loaderをawesome-typescript-loaderに変更
  • styleローダーをグローバルとローカル両方扱えるように修正
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.