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

Package Sidebar

Install

npm i conditional-pragma-loader

Weekly Downloads

4

Version

1.0.1

License

Apache-2.0

Last publish

Collaborators

  • robrichard