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
Add Conditional Exports in Popper v2 #1526
Conversation
There is no change log for this pull request yet. |
format === 'esm' && development && | ||
replace({ | ||
'process.env.NODE_ENV': '"development"', | ||
}), |
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.
Because I didn't want to alter anything about the existing build, __DEV__
will still be replaced by babel-plugin-dev-expression
. Then I replace the process.env.NODE_ENV
reference after that.
Based on Rich's comment here: sveltejs/kit#4504 (comment) Would it be enough to create a new But we could add a new folder using that extension. Libraries could then import from that folder instead of |
I'm going to close this PR. I'm OK with sticking with how V2 works at this point. If someone else has a different need that the new Thank you for working on the export maps in the current version of |
Fixes #1465.
This pull request is similar to #1502, but for the
v2.x
branch.I've left all existing distributions in place and have added 2 new files to use in the
development
andproduction
conditional exports:import.development
dist/esm/index.development.js
import.production
dist/esm/index.min.js
import.default
lib/index.js
module
.require
dist/cjs/popper.js
main
.I copied the entire "exports" format from the current version which means I also brought back the update from #1462. I can leave that out if you'd prefer.
Please let me know if I'm doing anything wrong here or if there's a different approach you would recommend.