I have a big webpack generated ui written in ES6 and I want to add an npm module that uses fs.readFileSync() named lumenize. The package is normally built with browserify. I'm having trouble configuring webpack to use bfrs from inside of ES6 code.
I've tried this configuration:
loaders: [
"transform?brfs",
"babel-loader"
],
and reversed the order, but neither works.
I've thought of trying to import the browserified version of the package, but that browserified version exposes a global polyfill for require() for use directly in the browser. I understand that's a no-no for webpack. Is that true? I could fork the project and remove that global exposure, but help with that configuration would be appreciated.
Try to put transform
in the postLoaders
section as it was described in transform-loader Readme:
postLoaders: [
{
loader: "transform?brfs"
}
],
loaders: [
{
test: /\.js$/,
loader: "babel"
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With