-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update structure and add webpacker #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the requested changes. Everything else is fine 🙂
config/webpacker.yml
Outdated
default: &default | ||
source_path: app/javascript | ||
source_entry_path: packs | ||
public_root_path: public | ||
public_output_path: packs | ||
cache_path: tmp/cache/webpacker | ||
webpack_compile_output: true | ||
|
||
# Additional paths webpack should lookup modules | ||
# ['app/assets', 'engine/foo/app/assets'] | ||
resolved_paths: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are not using webpack at all. As you can see here, webpack looks for assets in app/javascript
. You have 2 options here:
- Move all the existing assets to
app/javascript
(.js
go inapp/javascript/packs
). - Or, add
app/assets
on the list ofresolved_paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot it. I've added the assets path on the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to modify the app/javascript/packs/application.js
to include the assets which are going to be served through webpack and move all assets to app/javascript
as described on the webpacker documentation. Since we are short on time and this is not a major issue, we can postpone this for a later update.
NOTE: This applies to all other rails tutorials which @rojasTob updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mrcrow85 for your review. About the last improvement, I will create an issue explaining the last step that it needs to run Webpack. I will create it for each Rails repository.
I've updated the structure using the framework's command and install webpacker gem.