Created
July 15, 2020 05:16
-
-
Save kevinhq/081f2f247db8d7f4301fbcf9b92f699f to your computer and use it in GitHub Desktop.
Step-by-Step guide on how to move from Sprockets to Webpacker - erb.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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