Akryum / meteor-vite

MIT License
33 stars 16 forks source link

refactor: Migrate inline Vite plugin to a reusable module for the dev and production workers #28

Closed JorgenVatle closed 10 months ago

JorgenVatle commented 1 year ago

This pull request migrates the inline block-quote Vite plugin code to a standalone module that can be shared between the production build and the browser dev server.

This is done by extracting the string into its own Atmosphere package, where it is exported as both plain text for creating server-side worker files and normal file-paths for direct use by the development server.

This should hopefully make maintaining the Vite build plugin a little easier. 😊

JorgenVatle commented 1 year ago

I'm also working on some fixes for the unsupported export keywords. Possibly related to #27 #21.

I'm thinking that should left as a separate pull request?

red-meadow commented 1 year ago

Hi, @JorgenVatle! It's great to see such a big effort! I hope the project will eventually reach a production-ready state.

I'm also reading the source code now, trying to understand if it's possible to make the following imports working: import { xxx } from 'meteor/some:package/some/path'. For now, it's only possible to import from the package entry point. Do you have any ideas?

ADDED: I guess the solution must be similar to the one for packages with { lazy: true } option. We should automatically add such paths to meteor.mainModule.client entry file. It will force Meteor to include them into build/programs/web.browser.packages/some_package.js. Then we can parse some_package.js.

JorgenVatle commented 1 year ago

Oh, thank you for the additional details there. I'm writing up some tests on my end now and will get back to you once I have something. 🙌