-
Is it possible to add to an existing asset (e.g. appending HTML tags to the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Runtimes can add additional assets, so you can add a javascript asset that runs before a bundle's actual entrypoint is run: parcel/packages/runtimes/react-refresh/src/ReactRefreshRuntime.js Lines 31 to 35 in d33fcd9 In the case of HTML, the whole file is one asset (since 1 HTML source file becomes 1 HTML bundle), and multiple HTML assets in the same bundle don't have a defined order. (Note that this is a rather arbitrary implementation decision in WIP (plugin) docs: https://parcel2-docs.now.sh/plugin-system/ |
Beta Was this translation helpful? Give feedback.
Runtimes can add additional assets, so you can add a javascript asset that runs before a bundle's actual entrypoint is run:
parcel/packages/runtimes/react-refresh/src/ReactRefreshRuntime.js
Lines 31 to 35 in d33fcd9
In the case of HTML, the whole file is one asset (since 1 HTML source file becomes 1 HTML bundle), and multiple HTML assets in the same bundle don't have a defined order. (Note that this is a rather arbitrary implementation decision in
@parcel/packager-html
, you could write your own packager.)WIP (plugin) docs: https://parcel2-docs.now.sh/plugin-system/