Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

mipearson/webpack-rails-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-rails-demo

This repository demonstrates basic use of webpack-rails in a Rails 4.2 application.

Even though it demonstrates webpack-rails coexisting with sprockets, sprockets is not required or used by webpack-rails.

Usage

git clone https://github.com/mipearson/webpack-rails-demo.git
cd webpack-rails-demo
bundle install
npm install
foreman start

Then open localhost:3000 in your browser. If everything is working, you should see "Sprockets works!" and "Webpack works!"

Steps Taken

  1. Created new rails project: rails new --skip-keeps --skip-active-record --skip-spring --skip-turbolinks --skip-test-unit webpack-rails-demo
  2. Remove files, gems unnecessary for the demo
  3. Added webpack-rails to the Gemfile and ran bundle install
  4. Ran bundle exec rails generate webpack_rails:install
  5. Added controller, routes and views for "Welcome" page
  6. Added sprockets-based javascript for "Welcome" page
  7. Edited webpack/application.js
  8. Added *webpack_asset_paths to index.html.erb to load webpacked javascript
  9. Ran foreman start
  10. Opened localhost:3000, confirmed that both Sprockets & Webpack are loaded

About

Demo application for the webpack-rails gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published