|
|
|
|
|
by losvedir
3405 days ago
|
|
How do you handle versioning of the compiled assets and linking to them from the view? `<%= javascript_tag 'foo' %>` is the main benefit of the asset pipeline to me, so they can be long-expiring and busted with any change. I, too, agree that the asset pipeline is clunky. But at my startup we went the other way: use npm/webpack but compile the resulting file _into_ the assets directory, so we can still use the asset pipeline. It sort of double processes the assets but it was the only way I could think of to take advantage of modern JS with imports and exports, and still get the cache-busting goodness and easy rails view interoperability. |
|
Here's a blog post [1] explaining how to use webpack with rails.
[0] https://github.com/kossnocorp/assets-webpack-plugin
[1] http://clarkdave.net/2015/01/how-to-use-webpack-with-rails/#...