1.0.0 • Published 7 years ago

file-info-loader v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

npm version deps

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