-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using process.cwd
is problematic
#159
Comments
Ohhh great, and the ESM fallback is also not working and throwing: |
And building pino to ESM with esbuild fails Why oh why does the JS ecosystem suck so bad... |
Trying to generate different code depending on Code I tried if (currentBuild.initialOptions.format === 'esm') {
functionDeclaration = `
function pinoBundlerAbsolutePath(p) {
return new URL(p, import.meta.url).pathname;
}
`
} else {
functionDeclaration = `
function pinoBundlerAbsolutePath(p) {
return require('path').join(__dirname, p);
}
`
} |
The cwd is something that is for the user to use and not necessarily where the app files are, the code should use
__dirname
instead, possibly correcting for the relative path of wherepino
gets bundled into the root of the out dir.The text was updated successfully, but these errors were encountered: