-
Notifications
You must be signed in to change notification settings - Fork 938
Open
Description
I'm trying to integrate pino in my Electron app, I made the pino as externals in rspack, but I can't install the app because of Can not find module 'pino-std-serializers'. How do I fix this? This my bundler config, I wrote a custom plugin to load pino module
const pinoWorkerPlugin = (): RsbuildPlugin => ({
name: 'pino-worker-plugin',
setup(api) {
// Add the path override for pino worker
api.onBeforeBuild(() => {
const pinoWorkerPath = getPinoWorkerPath();
if (pinoWorkerPath) {
(
globalThis as { __bundlerPathsOverrides?: Record<string, string> }
).__bundlerPathsOverrides = {
'pino-worker': pinoWorkerPath,
};
}
});
api.modifyRspackConfig((config) => {
return {
...config,
externals: [
...(Array.isArray(config.externals) ? config.externals : []),
{
pino: 'pino',
'pino-pretty': 'pino-pretty',
'pino-roll': 'pino-roll',
'pino-std-serializers': 'pino-std-serializers',
},
],
experiments: {
...config.experiments,
outputModule: true,
},
};
});
},
});
Metadata
Metadata
Assignees
Labels
No labels