raw loader module for webpack
JavaScript
Latest commit 0f00b99 Jan 23, 2017 @SpaceK33z SpaceK33z committed on GitHub Merge pull request #16 from montogeek/patch-1
Fix Maintainers section look
Permalink
Failed to load latest commit information.
LICENSE Add LICENSE Dec 7, 2016
README.md Fix Maintainers section look Jan 23, 2017
index.js Removed deprecated feature Mar 26, 2014
package.json Update package.json license reference Oct 27, 2016

README.md

npm node deps tests coverage chat

Raw Loader

A loader for webpack that lets you import files as a string.

Install

npm install --save-dev raw-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: 'raw-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 'raw-loader!./file.txt';

Maintainers


Tobias Koppers