file-info-loader
v1.0.0
Published
File info loader module for webpack
Downloads
2
Readme
npm install --save-dev file-info-loader
Use the loader either via your webpack config, CLI or inline.
Inline
In your application
import txt from 'file-info-loader!./file.txt';
import js from 'file-info-loader!./file.js';
console.log(txt);
// {path: 'FULL-FILE-PATH', content: 'FILE RAW CONTENT'}
console.log(js);
// {path: 'FULL-FILE-PATH', content: 'FILE RAW CONTENT'}
Via webpack config
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.txt$/,
use: 'file-info-loader'
}
]
}
}
In your application
import txt from './file.txt';
Vladimir Shafikov