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

feat: add es.min format for lib mode #6585

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Bigfish8
Copy link
Contributor

@Bigfish8 Bigfish8 commented Jan 21, 2022

Description

resolve: #6555

Additional context

I found there seems no appropriate way for rollup to inject some meta data exposed to plugin.And my implementation might be inappropriate.

If you think the implementation is appropriate, I will add the test case.Otherwise i will change my implementation.

Thanks for you review!


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@poyoho
Copy link
Member

poyoho commented Jan 24, 2022

use fix #6555 to mentioned issues

@abarke
Copy link

abarke commented Feb 16, 2022

@Bigfish8 Would be really nice to have this merged. could you fix the tests? 🙏

This is by far the best and most elegant solution to solve #5167, #5451 and #6079

@Bigfish8
Copy link
Contributor Author

@abarke have fix the test.
@patak-dev It seems someone needs this PR.Do you have some suggestion on it?

@Niputi Niputi added p2-nice-to-have Not breaking anything but nice to have (priority) and removed needs rebase labels Feb 25, 2022
@@ -224,6 +224,16 @@ const rollupToEsbuildFormatMap: Record<
export const buildEsbuildPlugin = (config: ResolvedConfig): Plugin => {
return {
name: 'vite:esbuild-transpile',
outputOptions(opts) {
// @ts-ignore inject by resolveLibFormat call
if (opts.__vite_lib_minify__) {
Copy link
Member

Choose a reason for hiding this comment

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

the __vite_lib_minify__ can save into config: ResolvedConfig ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ResolvedConfig will include mutiple format,maybe both es and es.min.And save into config: ResolvedConfig making this case not work.

Copy link
Member

@poyoho poyoho Mar 2, 2022

Choose a reason for hiding this comment

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

Record<string, boolean>?

This comment was marked as abuse.

@abarke
Copy link

abarke commented Jun 22, 2022

Any movement here?

@Junior2Ran
Copy link

it seems that Build&Test: node-18, ubuntu-latest have been stucked, anybody knows how to restart it?

@abarke
Copy link

abarke commented Dec 9, 2022

Would be great to get this merged!

@abarke abarke mentioned this pull request Dec 9, 2022
4 tasks
@sinedied
Copy link

sinedied commented Dec 9, 2022

@poyoho would it be possible to elaborate a bit on what changes would be needed to get this merged?

It would really be useful to see this PR progressing, and I'm willing to help if needed.

@poyoho
Copy link
Member

poyoho commented Dec 10, 2022

@poyoho would it be possible to elaborate a bit on what changes would be needed to get this merged?

It would really be useful to see this PR progressing, and I'm willing to help if needed.

rebase?

@bluwy bluwy mentioned this pull request Apr 1, 2023
4 tasks
@Merieli
Copy link

Merieli commented Apr 6, 2023

I need this, how can I help?

@siarheipashkevich
Copy link

Any updates?

@Sec-ant
Copy link

Sec-ant commented Nov 2, 2023

Is there a workaround before this PR get merged? I'm aware of some custom plugins mentioned in #6555. But it seems none of them can correctly combine sourcemaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: library mode p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lib mode format: es.min