From 2fecc9863f510de2577596d4ba37b4249b5eeabe Mon Sep 17 00:00:00 2001 From: pan93412 Date: Sun, 21 Nov 2021 23:04:04 +0800 Subject: [PATCH 1/2] docs: add the bundling instruction for Webpack --- docs/bundling.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/bundling.md b/docs/bundling.md index 5d81a8b52..51909a2fe 100644 --- a/docs/bundling.md +++ b/docs/bundling.md @@ -2,6 +2,12 @@ Due to its internal architecture based on Worker Threads, it is not possible to bundle Pino *without* generating additional files. +## Webpack + +If you are a Webpack user, you can achieve this with [pino-webpack-plugin](https://github.com/pinojs/pino-webpack-plugin) without manual configuration of `__bundlerPathsOverrides`; however, if you are using other bundlers, you would need to configure it manually. + +## Manual Configuration + In particular, a bundler must ensure that the following files are also bundle separately: * `lib/worker.js` from the `thread-stream` dependency @@ -27,4 +33,4 @@ globalThis.__bundlerPathsOverrides = { }; ``` -Note that `pino/file`, `pino-worker`, `pino-pipeline-worker` and `thread-stream-worker` are required identifiers. Other identifiers are possible based on the user configuration. \ No newline at end of file +Note that `pino/file`, `pino-worker`, `pino-pipeline-worker` and `thread-stream-worker` are required identifiers. Other identifiers are possible based on the user configuration. From 8ba8a72ccb824cb1b60b66f5ec3ffa4a5f276f61 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Sun, 21 Nov 2021 23:33:41 +0800 Subject: [PATCH 2/2] docs: move Webpack section to improve readability --- docs/bundling.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/bundling.md b/docs/bundling.md index 51909a2fe..b6dd5c4f2 100644 --- a/docs/bundling.md +++ b/docs/bundling.md @@ -2,12 +2,6 @@ Due to its internal architecture based on Worker Threads, it is not possible to bundle Pino *without* generating additional files. -## Webpack - -If you are a Webpack user, you can achieve this with [pino-webpack-plugin](https://github.com/pinojs/pino-webpack-plugin) without manual configuration of `__bundlerPathsOverrides`; however, if you are using other bundlers, you would need to configure it manually. - -## Manual Configuration - In particular, a bundler must ensure that the following files are also bundle separately: * `lib/worker.js` from the `thread-stream` dependency @@ -34,3 +28,7 @@ globalThis.__bundlerPathsOverrides = { ``` Note that `pino/file`, `pino-worker`, `pino-pipeline-worker` and `thread-stream-worker` are required identifiers. Other identifiers are possible based on the user configuration. + +## Webpack Plugin + +If you are a Webpack user, you can achieve this with [pino-webpack-plugin](https://github.com/pinojs/pino-webpack-plugin) without manual configuration of `__bundlerPathsOverrides`; however, you still need to configure it manually if you are using other bundlers.