Neodymium Plated Magnet

    trim-loader

    0.5.1 • Public • Published

    Trim Loader

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

    This differs from raw-loader in that it trims the whitespace from the start and end of the string.

    Install

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

    Keywords

    none

    Install

    npm i trim-loader

    DownloadsWeekly Downloads

    3

    Version

    0.5.1

    License

    MIT

    Last publish

    Collaborators

    • leviathanbadger