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

can't access emitted filename within generateBundle #4744

Closed
danielroe opened this issue Dec 9, 2022 · 3 comments · Fixed by #4747
Closed

can't access emitted filename within generateBundle #4744

danielroe opened this issue Dec 9, 2022 · 3 comments · Fixed by #4747

Comments

@danielroe
Copy link
Contributor

Rollup Version

3.7.0

Operating System (or Browser)

MacOS

Node Version (if applicable)

v18.12.1

Link To Reproduction

https://github.com/danielroe/rollup-hash-repro

Expected Behaviour

I expect the filename generated to be available within generateBundle.

Note: I didn't include the REPL.it link as it worked as expected there (with rollup v1.31.0) until I upgraded the rollup version to 3.7.0 upon which it failed entirely with:

npx rollup --version & npx rollup -c
Cannot find module 'node:process'
Require stack:
- /home/runner/rollup-hash-repro/node_modules/rollup/dist/bin/rollup
exit status 1

Actual Behaviour

❯ pnpm build

> rollup-hash-repro@1.0.0 build /Users/daniel/sandbox/rollup-hash-repro
> rollup -c rollup.config.js


src/index → stdout...
something.mjs-!~{001}~.js

//→ index.js:
const foo = 'bar';

export { foo };

//→ something.mjs-58e57b33.js:
var test = 'bobaloo';

export { test as default };
@lukastaegert
Copy link
Member

Sorry about the REPL. It seems it still runs on Node 14. I really want to set up something new via StackBlitz but did not find the time.

In any case, this.getFileName should indeed work in generateBundle, I guess overlooked something here. Will have a look how I can fix this.

@lukastaegert
Copy link
Member

Yes, completely forgot about this when implementing the new hashing. Fix at #4747.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4747 as part of rollup@3.7.3. You can test it via npm install rollup.

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

Successfully merging a pull request may close this issue.

3 participants