raw-text-loader
Webpack loader to load pure raw text.
Install & Usage
npm i raw-text-loader --save-dev
Add loader config to your webpack config file, f.ex webpack.base.conf.js
module: loaders: test: /\.txt$/ loader: 'raw-text' // ...
Use case
In a recent Web app, I wanted to load text blocks from files instead of inlining or making a server request. The text will thus be inlined at compile time by Webpack :)
code: vm: view:
In this case, I used these files to display highlighted code examples.
Similar projects
These loaders both return the file content wrapped with: module.exports = JSON.stringify(content);
.
License
MIT