Upgrade Rails to 5.1.4 and webpacker

I deployed Rails app as v5.1.4 from v5.0.6 today.

During deployment, I felt a wee bit frustrated because of Webpacker.

As historical reasons, the app dependents on browserify(-rails) even though it depends on Webpack(er), and browserify is in devDependencies in package.json.

Webpacker does yarn install in rails assets:precompile, but it doesn’t install devDependencies if NODE_ENV=production.

I found the solusion for it, just add NPM_CONFIG_PRODUCTION=false to the assets precompile statement.

And I read issues and pull-requests on webpacker, it seems to regard compilation dependencies should be under dependencies not devDependencies.

It’s not comfortable, but I(we) have to obey the (sort of) rule when using a library.

Anyway, I have to discard shit browserify from the app.