conditional-pragma-loader

1.0.1 • Public • Published

conditional-pragma-loader

A webpack loader to ignore remaining loaders when the file does not contain a pragma.

Example

This will only run the babel-loader on *.js files that contain the pragma comment: /** @babel */.

// webpack.config.js
...
loaders: [
    {
        test: /\.js$/,
        loaders: [
            'conditional-pragma-loader?pragma=babel',
            'babel-loader'
        ]
    }
]
...

Caveats

Currently only works when chained with one additional loader

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i conditional-pragma-loader

Weekly Downloads

0

Version

1.0.1

License

Apache-2.0

Last publish

Collaborators

  • robrichard