README.md in webpacker-5.0.1 vs README.md in webpacker-5.1.0

- old
+ new

@@ -26,11 +26,10 @@ - [Usage](#usage) - [Development](#development) - [Webpack Configuration](#webpack-configuration) - [Custom Rails environments](#custom-rails-environments) - [Upgrading](#upgrading) - - [Yarn Integrity](#yarn-integrity) - [Integrations](#integrations) - [React](./docs/integrations.md#react) - [Angular with TypeScript](./docs/integrations.md#angular-with-typescript) - [Vue](./docs/integrations.md#vue) - [Elm](./docs/integrations.md#elm) @@ -81,11 +80,11 @@ Or add it to your `Gemfile`: ```ruby # Gemfile -gem 'webpacker', '~> 4.x' +gem 'webpacker', '~> 5.x' # OR if you prefer to use master gem 'webpacker', git: 'https://github.com/rails/webpacker.git' yarn add https://github.com/rails/webpacker.git yarn add core-js regenerator-runtime @@ -105,10 +104,16 @@ ```bash yarn upgrade ``` +When `package.json` and/or `yarn.lock` changes, such as when pulling down changes to your local environment in a team settings, be sure to keep your NPM packages up-to-date: + +```bash +yarn install +``` + ### Usage Once installed, you can start writing modern ES6-flavored JavaScript apps right away: ```yml @@ -298,30 +303,10 @@ # Or to install the latest release (including pre-releases) yarn add @rails/webpacker@next ``` -### Yarn Integrity - -By default, in development, webpacker runs a yarn integrity check to ensure that all local JavaScript packages are up-to-date. This is similar to what bundler does currently in Rails, but for JavaScript packages. If your system is out of date, then Rails will not initialize. You will be asked to upgrade your local JavaScript packages by running `yarn install`. - -To turn off this option, you will need to change the default setting in `config/webpacker.yml`: - -```yaml -# config/webpacker.yml -development: - ... - # Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules - check_yarn_integrity: false -``` - -You may also turn on this feature by adding the config option for any Rails environment in `config/webpacker.yml`: - -```yaml -check_yarn_integrity: true -``` - ## Integrations Webpacker ships with basic out-of-the-box integration. You can see a list of available commands/tasks by running `bundle exec rails webpacker`. Included install integrations: @@ -410,9 +395,11 @@ ``` ## Deployment Webpacker hooks up a new `webpacker:compile` task to `assets:precompile`, which gets run whenever you run `assets:precompile`. If you are not using Sprockets, `webpacker:compile` is automatically aliased to `assets:precompile`. Similar to sprockets both rake tasks will compile packs in production mode but will use `RAILS_ENV` to load configuration from `config/webpacker.yml` (if available). + +When compiling assets for production on a remote server, such as a continuous integration environment, it's recommended to use `yarn install --frozen-lockfile` to install NPM packages on the remote host to ensure that the installed packages match the `yarn.lock` file. ## Docs - [Development](https://github.com/rails/webpacker#development) - [Webpack](./docs/webpack.md)