infinum / webpack-asset-pipeline

🚀 A missing link for the asset pipeline alternative with Webpack.
https://infinum.co/the-capsized-eight/squeezing-webpack-into-backend-frameworks
MIT License
30 stars 5 forks source link

Monkey patching asset pipeline helpers in RoR #2

Closed andreicek closed 8 years ago

andreicek commented 8 years ago

In the readme there is already support for adding a new helper but it would be much better if there was also a way to monkey patch other helpers that will stop working.

andreicek commented 8 years ago

One more thing: it should be added that all the files have to be required in the JavaScript in order for webpack to process them.

Eg. files.js

require('images/file1.jpg');
require('images/file2.jpg');
require('images/file3.jpg');

And then in application.js (your entrypoint)

require('file');

This note can be placed under a new chapter of README: eg. Example. If needed also modify the example/ folder to mirror the usage.

And then you can use it in your HTML

<img src="#{webpack_asset_url('images/file1.jpg')}" alt="logo" />
gabskoro commented 8 years ago

This is done at PRs #13 and #14