diff --git a/rails/create-release/README.md b/rails/create-release/README.md index 8e3435e..2942fe9 100644 --- a/rails/create-release/README.md +++ b/rails/create-release/README.md @@ -34,13 +34,16 @@ Those file will be placed relativ to the shared folders and symlinked into the r Just set this variable in your provisioning/deployment: -``` +```yaml rails_webpacker: yes + +# if you are using Webpacker 4+, change that to: +rails_webpacker: 4 ``` This will: -1. (this role) Export these files from git in addition to the defaults: yarn.lock package.json .babelrc .postcssrc.yml +1. (this role) Export these files from git in addition to the defaults: yarn.lock package.json .babelrc .postcssrc.yml (babel.config.js and postcss.config.js if using Webpacker 4) 2. (this role) Keep/Symlink public/packs and node_modules between deployments 3. (asset precompilation) ``rake yarn:install`` is run by ``rails assets:precompile`` (from +5.1), if a bin/yarn binstub is provided. **NOTE** without that binstub no node_modules are installed! Make sure to add it with ``rails app:update:bin`` and commit to your app repo. diff --git a/rails/create-release/defaults/main.yml b/rails/create-release/defaults/main.yml index 28b011a..be54339 100644 --- a/rails/create-release/defaults/main.yml +++ b/rails/create-release/defaults/main.yml @@ -46,11 +46,15 @@ rails_deploy_custom_create_folders: [] # custom folders that are created for eac # Webpacker / yarn default settings rails_webpacker: no + rails_deploy_webpacker_archive: - yarn.lock - package.json -- .babelrc -- .postcssrc.yml +- "{% if rails_webpacker_use_webpacker == 4 %}babel.config.js{% else %}.babelrc{% endif %}" +- "{% if rails_webpacker_use_webpacker == 4 %}postcss.config.js{% else %}.postcssrc.yml{% endif %}" + + + rails_deploy_webpacker_pack_dir: public/packs rails_deploy_custom_shared_webpacker_folders: ['{{rails_deploy_webpacker_pack_dir}}', 'node_modules']