module-federation/vite

Can the library provide an uncompressed code version in the build product?

He110te4m opened this issue · 8 comments

When I need to debug the plugin code, it's hard to modify dist directly to debug because the code is compressed and hard to read.

I have to go through the following steps:

  1. Download the latest code for the plugin
  2. Build using the watch pattern
  3. Insert my debugging code into the source code
  4. Replace the built product with my project

If the library provides an uncompressed version, I can replace it directly in the project dist, which is much more convenient and efficient.

gioboa commented

Ship uncompressed is not a best practice.
An alternative could be include the plugin code in you project and import the plugin directly from your codebase.

Why do you think uncompressed code is not a best practice?

This plugin is only likely to be used during development and not built into dist.

Even if the user needs to build again, the corresponding compression tool will handle it.

Even if the user builds again without compression, this functionality will only be used as another tool in the development phase.

I didn't think of any situation where compression would be better than non-compression.

As you said, including the code in the project makes it difficult to update later when you upgrade the plugin version.

All subsequent changes will be maintained by myself.

This means that all subsequent changes will be maintained by myself.

Is the plugin simply a template for a project's internal plugin?

Let the user customize the plugin function, solve the plugin problem?