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

Add options.onEvent, aiming to add event listeners to the build process. #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YangYongAn
Copy link
Contributor

In the case in bundle mode , if multiple entries reference the same style file, the generated CSS file will repeatedly include this style file.

Here is a detailed example: In test/repeat-css, the components demo are referenced in both pages/main and pages/sub, and it's clear that the style file of demo appears multiple times in the dist output.

Therefore, I need to add event listeners (options.onEvent) during the build process to broadcast the input and output of each action in the build process through events. This will allow other plugins to further process the source data in the onEnd phase, such as separating CSS files into external files based on the import path.

@YangYongAn
Copy link
Contributor Author

Although there are many diffs generated by the changes, and it seems like they are not related to the main functionality, this feature is indeed very useful to me.

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.

1 participant