Closed
Description
From a long discussion on #464, this issue will summarize. I'll soon be posting proposed changes to the README.md.
Demo: https://github.com/justin808/webpacker-demo-webpacker_lite-merge
Summary of changes
- Move base url out from manifest.json to manifest.rb
- Assign env variables to dev server settings so it can be overridden at runtime.
- The keys for dev_server should use same format as of now as documented in Paths on the README.md. Note that
hot
is a new setting to indicate that the dev_server is used with hot reloading, which means that CSS should be inlined to be hot loaded.- The presence of dev_server means that the webpack-dev-server is used for the given env.
development:
# put the created files to the /public/webpack/development directory
public_output_path: webpack/development
# if dev_server is not provided, then dev_server is not used
dev_server:
hot: true # This is a new setting
static: false
host: localhost
https: false
CC: @gauravtiwari
Activity
justin808 commentedon Jul 26, 2017
@gauravtiwari, React on Rails will handle compilation of files separately than the bin/webpack task.
Thus, the caching for compilation won't work (without some changes).
Instead, React on Rails needs the check if the bundle is created, per this line.
So I have a lookup method that does not necessarily throw, and will trigger the loading of the instance.
Please let me know your thoughts on this one.
Maybe if the API changes are minimal, we can release a beta version of the Webpacker gem that works with React on Rails, and then we can assess the next step.
In React on Rails.
justin808 commentedon Jul 29, 2017
@gauravtiwari @dhh,
I added a demo: https://github.com/justin808/webpacker-demo-webpacker_lite-merge. My next step is to create a beta of React on Rails that depends on this version of Webpacker. Is there anything you'd like to see me do?
Support React on Rails by merging Webpacker Lite
Support React on Rails by merging Webpacker Lite