1.0.1 • Published 9 years ago

conditional-pragma-loader v1.0.1

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
9 years ago

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