A bug is a crash or incorrect behavior. If you have a debugging or troubleshooting question, please open a discussion.
Environment
- Ruby version: 3.3.0
- Rails version: 7.1.3.2
- Shakapacker/Webpacker version: 6.5.6
- React on Rails version: 13.4.0
Expected behavior
- Running
bin/rake react_on_rails:generate_packs should always add the import like
// import statement added by react_on_rails:generate_packs rake task
import "./../generated/server-bundle-generated.js"
to the server_bundle_js_file if it's missing there.
2. On the other hand, if the import is present already, it shouldn't be added.
3. The comment could include suggestion to rerun the task if the generated file is missing.
Actual behavior
When the generated files already exist, the import isn't added.
Small, reproducible repo
- Run
bin/rake react_on_rails:generate_packs in the dummy app. The import line is added.
- Run
git reset --hard HEAD
- Run
bin/rake react_on_rails:generate_packs again. The import line is not added.