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
moduleexports = module: rules: test: /\.txt$/ use: 'trim-loader'
In your application
;
CLI
webpack --module-bind 'txt=raw-loader'
In your application
;
Inline
In your application
;