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
fix(node-resolve): build before publishing for correct version #1063
Conversation
re: #1050 (comment) Can we leave that dynamic at runtime? Or is making that part of the build a concern about running in the browser? |
I do not think you can run this plugin in the browser anyway, so we could also do this dynamically. Will change it. |
f5f9ef2
to
6024772
Compare
6024772
to
c68c42b
Compare
Done |
name: 'external-package-json', | ||
resolveId(source) { | ||
if (source.endsWith('package.json')) { | ||
return { id: '../../package.json', external: true }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for posterity we should add a comment for why it's looking in the parent-parent directory
Ah, just as I was thinking about this, there is actually a reason we cannot do it dynamically after all, otherwise the ESM build would be importing a JSON file, and that is not valid (well, you CAN import JSON from a module in latest Node, but you would need to use import assertions, and, ah well, not sure if I can pull this off easily without a big hack). |
c68c42b
to
43dac73
Compare
43dac73
to
1ce4b55
Compare
Reverted it back |
Rollup Plugin Name:
node-resolve
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
Currently, the version embedded as
version
property into the plugin object is always one version behind. This should fix it by running another build immediately before the package is actually published (which happens after the version has been incremented).