Skip to content

tt-52101/raw-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

npm node deps 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


Juho Vepsäläinen

Joshua Wiens

Kees Kluskens

Sean Larkin

About

raw loader module for webpack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%