Giter Club home page Giter Club logo

webpack-rails-demo's Introduction

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

webpack-rails-demo's People

Contributors

mipearson avatar

Watchers

Gail Steiger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.