-
Notifications
You must be signed in to change notification settings - Fork 128
Upgrading to Pageflow Scrolled 16.2.0
Warning
This page is still work in progress.
Pageflow 16.2 switches from the unmaintained Webpacker gem to Shakapacker.
In your host application, delete all Webpacker related files:
bin/webpack
bin/webpack-dev-server
config/webpack/development.js
config/webpack/environment.js
config/webpack/production.js
config/webpack/test.js
config/webpacker.yml
Remove entries for webpacker
and uglifier
from your Gemfile
and add shakapacker
and terser
instead:
# Gemfile
- gem 'uglifier', '>= 1.3.0'
+ gem 'terser', '~> 1.1'
- gem 'webpacker', '~> 4.2'
+ gem 'shakapacker', '~> 7.1'
Then run
$ bundle install
and change your production environment to use terser
:
# config/environments/production.rb
- config.assets.js_compressor = :uglifier
+ config.assets.js_compressor = :terser
Install Shakapacker:
$ ./bin/rails shakapacker:install
This will ask to override your package.json
file. If you have customized the file, review the diff. Otherwise accept the change. In particular, make sure to restore the changes to your application's package.json
file to depend on the pageflow
and pageflow-scrolled
packages which are distributed as part of the pageflow gem:
{
"scripts": {
"preinstall": "bundle exec rake pageflow_scrolled:create_bundle_symlinks_for_yarn"
},
"dependencies": {
...
"pageflow": "file:.bundle/for-yarn/pageflow/package",
"pageflow-scrolled": "file:.bundle/for-yarn/pageflow/entry_types/scrolled/package",
...
}
}
Then run
$ yarn install --force
Re-run the Pageflow Scrolled install generator and review changes:
$ ./bin/rails generate pageflow_scrolled:install