JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2959434
  • Score
    100M100P100Q193325F
  • License MIT

raw loader module for webpack

Package Exports

  • raw-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (raw-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

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