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

Use package.json#exports #565

Merged
merged 5 commits into from
Jul 3, 2023
Merged

Use package.json#exports #565

merged 5 commits into from
Jul 3, 2023

Conversation

Andarist
Copy link
Member

@Andarist Andarist commented Jul 2, 2023

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Jul 2, 2023

🦋 Changeset detected

Latest commit: f2112b3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@preconstruct/cli Minor
@preconstruct/eslint-plugin-format-js-tag Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Jul 2, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (58df49f) 92.19% compared to head (ae3c481) 92.19%.

❗ Current head ae3c481 differs from pull request most recent head f2112b3. Consider uploading reports for the commit f2112b3 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #565   +/-   ##
=======================================
  Coverage   92.19%   92.19%           
=======================================
  Files          40       40           
  Lines        1973     1973           
  Branches      595      595           
=======================================
  Hits         1819     1819           
  Misses        144      144           
  Partials       10       10           
Impacted Files Coverage Δ
packages/cli/src/rollup-plugins/prod-dev-entry.ts 100.00% <ø> (ø)
.../src/rollup-plugins/inline-process-env-node-env.ts 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

// tricking static analysis is fun
// @ts-ignore
process["e" + "nv"].NODE_ENV = "production";
process.env.NODE_ENV = "production";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this even needed now? I'm not sure what this was about

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because some babel plugins might rely on process.env.NODE_ENV and Preconstruct is basically always meant for building for "production"

@Andarist Andarist marked this pull request as ready for review July 2, 2023 22:27
.changeset/new-kids-itch.md Outdated Show resolved Hide resolved
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming the main reason to do this is to avoid the dev vs prod bundle so it's a bit easier to patch, yeah? it's not like the package.json#exports field really matters here?

@emmatown emmatown merged commit 484c6a7 into main Jul 3, 2023
8 checks passed
@emmatown emmatown deleted the use-exports branch July 3, 2023 00:39
@github-actions github-actions bot mentioned this pull request Jul 3, 2023
@Andarist
Copy link
Member Author

Andarist commented Jul 3, 2023

I'm assuming the main reason to do this is to avoid the dev vs prod bundle so it's a bit easier to patch, yeah?

Yeah, exactly.

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

Successfully merging this pull request may close these issues.

None yet

2 participants