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(worker): support worker format, plugins and rollupOptions (#6191) #6351

Merged
merged 28 commits into from
Jan 2, 2022

Conversation

poyoho
Copy link
Member

@poyoho poyoho commented Jan 2, 2022

Description

fix: #6191

Additional context

shallow copy of the plugin config


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 Author

poyoho commented Jan 2, 2022

Duplicate of #6243

@poyoho
Copy link
Member Author

poyoho commented Jan 2, 2022

@egasimus @patak-dev new PR here!👋

@patak-dev patak-dev merged commit 133fcea into vitejs:main Jan 2, 2022
@patak-dev
Copy link
Member

Thanks @poyoho!

@egasimus
Copy link

egasimus commented Jan 2, 2022

@patak-dev Sorry if offtopic, but does this mean a new release soon? Can't seem to get Vite from Git working with my setup and I'm really eager to try this out.

@patak-dev
Copy link
Member

@egasimus this will be part of vite 2.8. We plan to release vite@2.8.0-beta.0 during the next week if everything goes right

@eyun-tv
Copy link

eyun-tv commented Jan 19, 2022

imageimage

seems not work ? I use coffeescript and vite v2.8.0-beta.3
I added worker and rollup-plugin-coffee2 in config

I forked the vite and write a demo error code in there :
main...eyun-tv:main

@patak-dev
Copy link
Member

Hey @eyun-tv! Thanks for testing this feat! Would you create an issue with that demo as a minimal reproduction so we can better track this bug? (if you can, you can upload it in https://vite.new)

@eyun-tv
Copy link

eyun-tv commented Jan 27, 2022

@patak-dev
Copy link
Member

Thanks for the reproduction @eyun-tv, please create a new bug report with it so we can properly track it.

@poyoho
Copy link
Member Author

poyoho commented Feb 25, 2022

hi @eyun-tv

I think maybe the error in coffee plugin

coffee = (config = {}) => {
    return {
      name: 'coffee',
      transform: function(src, id) {
        var code, map;
        if (/\.coffee$/.test(id)) {
          ({
            js: code,
            sourceMap: map
          } = CoffeeScript.compile(src, config));
          return {code, map};
        }
      }
    };
  };

vite will resolve the request id to worker.coffee?worker, so the plugins no work 🤔

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.

Dependencies of web worker module won't be handled by plugins with vite build
5 participants