1.2.0 • Published 2 years ago

@rhyswfbowles/pino-webpack-plugin v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

pino-webpack-plugin

Why have we created this fork?

Currently, we're in a bit of a messy situation where lambdas require one webpack version to function, but this package is pulling us up to a different version which is causing it to fail. We cannot use package.json resolutions as storybook currently does not support webpack 5.0 until their 7.0 release as per this issue https://github.com/storybookjs/storybook/issues/17436

Package Version Dependency Status Build

A pino plugin for webpack.

Installation

Just run:

npm install pino-webpack-plugin

Description

This plugin allows to use of pino v7 with webpack generated bundle files.

Note that, due to pino architecture (based on Node.js' Worker Threads), it is not possible to make it work without generating extra files.

This means that when using this plugin the following list of files will be generated at the root of your dist folder:

  • thread-stream.js
  • pino-worker.js
  • pino-pipeline-worker.js
  • pino-file.js
  • A file for each transport you specify in the plugin constructor's transports option. (see below)

Each of the additional file is a bundle and therefore does not contain any external dependency, but it is needed to use pino and it must be included in the deployment.

Usage

Simply include the plugin in your webpack configuration. Make sure you provide the plugin a list of all the pino transports you use via the transports option (pino/file is always included so no need to specify it).

const { PinoWebpackPlugin } = require('pino-webpack-plugin')

module.exports = {
  entry: 'index.js',
  plugins: [new PinoWebpackPlugin({ transports: ['pino-pretty'] })]
}

Contributing

See CONTRIBUTING.md

License

Copyright Paolo Insogna and pino-webpack-plugin contributors 2021. Licensed under the MIT License.

1.2.0

2 years ago

1.1.0

2 years ago