fix(node-resolve): build before publishing for correct version#1063
fix(node-resolve): build before publishing for correct version#1063shellscape merged 1 commit intomasterfrom
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.
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-resolveThis 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
versionproperty 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).