Right now, the rails new app_name --template /path/to/template.rb
supports after_bundle
scripts, but does not support after_yarn
.
Because of that, I’m unable to create a template that’d support:
- Installation of NPM packages upon the project initialization.
- Coping yarn.lock file to my docker container via Dockerfile.
- Writing a .docker-compose.override.yml with the
webpacker
service and runningdocker-compose build
command.
This happens because the bundle installs before the yarn does.
There’s a lot going on after the run bundle install
, which is:
run bundle install
run bundle binstubs bundler
rails webpacker:install
create config/webpacker.yml
create config/webpack
create config/webpack/development.js
create config/webpack/environment.js
create config/webpack/production.js
create config/webpack/test.js
create postcss.config.js
create babel.config.js
create .browserslistrc
apply /Users/me/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/webpacker-5.2.1/lib/install/binstubs.rb
exist bin
create bin/webpack
create bin/webpack-dev-server
append .gitignore
run yarn add @rails/webpacker@5.2.1 from "."
run yarn add --dev webpack-dev-server from "."
How do you feel about adding the after_yarn
?