-
Notifications
You must be signed in to change notification settings - Fork 16
feat: transform plugins #34
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
===========================================
+ Coverage 72.37% 84.10% +11.72%
===========================================
Files 9 19 +10
Lines 601 868 +267
Branches 96 178 +82
===========================================
+ Hits 435 730 +295
+ Misses 165 137 -28
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
That was fast 🚀 I will check better later. In the meantime, can you examine how compatible the current implementation is with mkdist and vue-sfc-transformer API? 🙏🏼 |
Using the loader from |
eaccb0d
to
253cf48
Compare
Cool! We probably have to also support alternative |
I'll leave some notes here about the current process if we want to do this later. With
|
Thanks for the notes. /cc @danielroe @Teages re vue-sfc types part. |
I moved every non-core code to the new monorepo and updated the first post in this PR to reflect the changes more accurately. |
Important I had to add |
Resolves #6
Resolves #33
Resolves #35
Originally posted by @pi0 in #6
I made this as a starting point for further discussions about #6, it's mainly based on the
mkdist
loaders.New features in this PR:
Plugin support for transform entries.
Plugin monorepo will be available here soon: https://github.com/unjs/obuild-plugins
Until the packages are not published, they are packed and resolved from the
/plugins
dir in this PR.Possible setup:
Plugins have a
transform()
method, we call these recursively in the order that is provided in the configuration.Plugins can also have temp. storage assigned to them for each entry context. This is useful when you for example define the plugins once and use them for multiple entries with the same configuration.
TS Config resolution
On build start we find and resolve all paths in the TS Config to absolute paths based on where the actual configuration coming from. (TS config entries can also be added into the transform entries).
Later the transform plugins can use these to make relative paths based on their requirements.
Source map serialization/path rewrite
The plugins don't have enough context to know where each file will be written to, this is done here.
Added
mapDir
config option to write these separately. (This directory is not cleaned on each build automatically)declarationDir
supportWhen provided in TS config, the declarations are written in the provided directory (This directory is not cleaned on each build automatically)