Nibbling Perfect Macaroni

    strip-whitespace-loader
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.4 • Public • Published

    strip-whitespace-loader

    node Travis AppVeyor Known Vulnerabilities David Greenkeeper badge Coveralls Codacy grade

    Strip-Whitespace-Loader is a loader for webpack that will remove extraneous spaces from strings. It's perfect for working with rendering templates (ex. mustache, handlebars) or es6 javascript templates. It works with anything where you might create very long strings.

    Before strip-whitespace-loader:
    function() {
      if (condition) {
        const longString = '  String   with    some    extra   spaces  ';
      }
    }
    After strip-whitespace-loader:
    function() {
      if (condition) {
        const longString = ' String with some extra spaces ';
      }
    }
    Webpack usage
    {
      module: {
        rules:[
          {
            test: /\.js$/,
            loader: [ 'strip-whitespace-loader', 'babel-loader' ]
          },
          {
            test: /\.tsx?$/,
            loader: [ 'strip-whitespace-loader', 'ts-loader' ]
          }
        ]
      }
    }

    Install

    npm i strip-whitespace-loader

    DownloadsWeekly Downloads

    163

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • markis