rstacruz / npm-pipeline-rails

Use npm as part of your Rails asset pipeline
95 stars 14 forks source link

Webpack support #18

Closed rstacruz closed 7 years ago

rstacruz commented 7 years ago

npm-pipeline-rails has always supported Webpack. This PR goes even further by adding:

rails g npm_pipeline:webpack

It comes with a preset configuration with some modern amenities:

mikker commented 7 years ago

This looks great! I like the two levels of config – perfect for newcomers to webpack. I haven't tried it but I like the concept of postcss-asset-url-rails.

I saw that Rails was getting its own yarn and webpack integrations in 5.1. Do you know if that'll look like this? Or will there still be a place for this project after 5.1?

rstacruz commented 7 years ago

I saw that Rails was getting its own yarn and webpack integrations in 5.1. Do you know if that'll look like this? Or will there still be a place for this project after 5.1?

I'm hoping this project gets deprecated then, to be honest! First-class integration is always better than third-party integrations.

...Or at least, has a potential to be better. At this point there are still many things unknown about their Yarn/Webpack implementation that I can't really say what the future will be for Webpack + Rails.

Also worth noting is that there's webpack-rails. npm-pipeline-rails is a lighter integration that doesn't need the Webpack dev server, and still relies on Rails for asset fingerprinting and minification features.