1.0.5 • Published 6 years ago

raw-extend-loader v1.0.5

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago
npm install --save-dev raw-extend-loader

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: [
          {
            loader: require.resolve('raw-extend-loader'),
            options: {
              dir: '/path/md', // Copy to the '/path/md' directory.
              filename: 'dir', // "underline | dir"
              sep: '___', // filename="underline", File name to the directory, using '___' interval, default value '__'.
            },
          },
        ],
      }
    ]
  }
}

option

  • dir Copy to the '/path/md' directory.
  • filename Optional underline | dir, According to the directory to store, or do not create a directory.
  • sep Set filename="underline", File name to the directory, using ___ interval, default value __.

In your application

import txt from './file.txt';

CLI

webpack --module-bind 'txt=raw-extend-loader'

In your application

import txt from 'file.txt';

Inline

In your application

import txt from 'raw-extend-loader!./file.txt';
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago