Install
npm i transform-loader --save
Usage
Pass the module name as query parameter.
var x = ;var x = ; // cacheable version
If you pass a number instead it will take the function from this.options.transforms[number]
.
Webpack 2.x Config Example
moduleexports =module:rules:loader: "transform-loader?brfs"enforce: "post"test: /\.coffee$/loader: "transform-loader/cacheable?coffeeify"test: /\.weirdjs$/loader: "transform-loader?0"plugins:options:transforms:{return;};
Webpack 1.x Config Example
moduleexports =module:postLoaders:loader: "transform-loader?brfs"loaders:test: /\.coffee$/loader: "transform-loader/cacheable?coffeeify"test: /\.weirdjs$/loader: "transform-loader?0"transforms:{return;};
Typical brfs Example
Say you have the following Node source:
var test = ;
After npm install transform-loader brfs --save
, add the following loader to your config:
moduleexports = context: __dirname entry: "./index.js" module: loaders: test: /\.js$/ loader: "transform-loader?brfs"
The loader is applied to all JS files, which can incur a performance hit with watch tasks. So you may want to use transform-loader/cacheable?brfs
instead.
Maintainers
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |