How to make this work in webpack?
var templateHtml = require("text!templates/main.html");
console.log(templateHtml); // outputs string content of the "main.html" file
I need to migrate from requirejs + require-text plugin to webpack with minimum code changes so I need that loader in webpack... Have any suggestions?
Should use 'text-loader': https://www.npmjs.com/package/text-loader
My mistake was that I used both text!
notation in require
and loaders
config with "text-loader".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With