Skip to content

Instantly share code, notes, and snippets.

@123ish
Forked from kevinhq/erb.js
Created August 15, 2020 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 123ish/ee68ef88911f16ee879ec3ef0f7a07e9 to your computer and use it in GitHub Desktop.
Save 123ish/ee68ef88911f16ee879ec3ef0f7a07e9 to your computer and use it in GitHub Desktop.
Step-by-Step guide on how to move from Sprockets to Webpacker - erb.js
// config/webpack/loaders/erb.js
module.exports = {
test: /\.erb$/,
enforce: 'pre',
exclude: /node_modules/,
use: [{
loader: 'rails-erb-loader',
options: {
runner: (/^win/.test(process.platform) ? 'ruby ' : '') + 'bin/rails runner'
}
}]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment