A webpack block that injects bows (a console.log replacement) into source files.
This package uses bows-loader under the hood.
$ yarn add -D webpack-blocks-bows
Or with npm:
$ npm install --save-dev webpack-blocks-bows
const { createConfig } = require('@webpack-blocks/webpack2');
const babel = require('@webpack-blocks/babel6');
const bows = require('webpack-blocks-bows');
const config = createConfig([
babel(),
bows(),
]);
Then, you can use the global log(...)
in place of console.log(...)
.
Checkout the bows documentation for more details.
Since you'll be using a new global in your source, eslint should complain about this. Either add
log
as a global, or use eslint-config-bows-loader.
Returns a webpack block that injects bows global log(...)
function.
Parameters
options
Options
Returns Function
Type: (string | RegExp | Array<string> | Array<RegExp>)
Type: {exclude: Exclude?}
Properties
exclude
Exclude?