0.5.1 • Published 7 years ago
trim-loader v0.5.1
Trim Loader
###A loader for webpack that lets you import files as a trimmed string.
This differs from raw-loader in that it trims the whitespace from the start and end of the string.
Install
npm install --save-dev trim-loader
Usage
Use the loader either via your webpack config, CLI or inline.
Via webpack config (recommended)
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.txt$/,
use: 'trim-loader'
}
]
}
}
In your application
import txt from 'file.txt';
CLI
webpack --module-bind 'txt=raw-loader'
In your application
import txt from 'file.txt';
Inline
In your application
import txt from 'trim-loader!./file.txt';
0.5.1
7 years ago