Add `webc:bundler` abstraction for user to handle bundling themselves using their own bundler
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 46
- Avg merge
- 10m
- Merged PRs (30d)
- 2
Description
Tried to make a customTransform called esbuild to transform esm javascript that imports node modules and local modules
src
- page.webc
- live-reload.js
- diagrams.js
src/page.webc
<script webc:type="esbuild" src="./live-reload.js"></script>
src/diagrams.js
import mermaid from 'mermaid' // or any other installed node_module
/* magic */
export default {}
src/live-reload.js
import diagrams from './diagrams.js'
/* code that uses diagrams */
Looks like a common enough use case. I don't think customTransforms were made for this. And transforms are not sufficient for this since get the content and not the src paths. And they are executed once per node, instead of once per compilation
Feels like we need a similar abstraction for bundled assets which operate on src paths
<script webc:bundler="esbuild" src="./live-reload.js"></script>
Thoughts?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing customTransform behavior and the compilation lifecycle, focusing on how transforms receive content and are invoked per node. Compare that with the proposed webc:bundler attribute and its src-path-based, per-compilation behavior; done means the abstraction and its expected user-facing behavior are defined and supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100