Skip to content
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

Support bundling pino-pretty #144

Open
glensc opened this issue Mar 13, 2024 · 2 comments
Open

Support bundling pino-pretty #144

glensc opened this issue Mar 13, 2024 · 2 comments

Comments

@glensc
Copy link

glensc commented Mar 13, 2024

Would it be possble support creating bundle for "pino-pretty" wrapper as well?

I added node_modules/.bin/pino-pretty" to entryPoints:

build({
  entryPoints: [
    "./src/index.ts", // <-- or whatever was before
    "./node_modules/.bin/pino-pretty",
  ],

it created bundle, but seems it expect some files to be unbundled:

✖ dist/node_modules/.bin/pino-pretty.js
/dist/node_modules/.bin/pino-pretty.js:40
        throw new Error(`${opts.dir} is not a directory`);
        ^

Error: /dist/node_modules/.bin/help is not a directory
    at helpMe (/dist/node_modules/.bin/pino-pretty.js:40:15)
    at Object.<anonymous> (/dist/node_modules/.bin/pino-pretty.js:15744:29)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49

Node.js v18.19.1
@glensc
Copy link
Author

glensc commented Mar 13, 2024

I guess the problematic part is from here:

➜ readlink -f node_modules/.bin/pino-pretty
node_modules/pino-pretty/bin.js

➜ ls -l node_modules/pino-pretty/help  
total 4.0K
-rw-r--r-- 1 glen staff 3.5K Jan 17 14:22 help.txt

➜ 

@glensc
Copy link
Author

glensc commented Mar 13, 2024

for now, could just copy missing directory:

install -d dist/node_modules/.bin; cp -a node_modules/pino-pretty/help dist/node_modules/.bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant