https://github.com/brycerussell/inject-asset-prototype
Inject static assets and access bundled paths from inside an Astro integration
https://github.com/brycerussell/inject-asset-prototype
Last synced: 5 months ago
JSON representation
Inject static assets and access bundled paths from inside an Astro integration
- Host: GitHub
- URL: https://github.com/brycerussell/inject-asset-prototype
- Owner: BryceRussell
- Created: 2024-03-10T17:43:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T03:31:33.000Z (about 2 years ago)
- Last Synced: 2025-04-04T22:28:10.355Z (about 1 year ago)
- Size: 3.41 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prototypes for injecting static assets into Astro bundle
**Basic Idea**
```ts
"astro:config:setup": (params) => {
// Should inject an asset into the build and return the path that it is available at client side
asset = injectAsset({
entrypoint: "C:/.../styles.css",
});
},
```
### Why?
- Inject static assets from anywhere
- Include assets inside the Astro bundle
- Access the bundled/hashed path of an asset inside an integration
### Strategies
Explore different strategies in the list below. Each strategy is a branch that includes explainations, limitations, examples, playground, etc
- [Static Analysis](https://github.com/BryceRussell/inject-asset-prototype/tree/static-analysis)
- [Getter Function](https://github.com/BryceRussell/inject-asset-prototype/tree/getter-function)