Skip to content

Commit

Permalink
Added new config option rails_webpacker to better support v4
Browse files Browse the repository at this point in the history
Webpacker 4 changed default config files babelrc and postcssrc:
rails/webpacker@8d496a0
  • Loading branch information
Wolfgang Wohanka authored and zealot128 committed Apr 27, 2019
1 parent 680b2e9 commit b18fd0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions rails/create-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 6 additions & 2 deletions rails/create-release/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit b18fd0e

Please sign in to comment.