Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uppercod/vite
https://github.com/uppercod/vite
Last synced: about 3 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/uppercod/vite
- Owner: UpperCod
- Created: 2021-05-08T04:56:55.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-12-24T04:14:32.000Z (almost 3 years ago)
- Last Synced: 2024-11-01T23:37:30.483Z (4 days ago)
- Language: JavaScript
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @uppercod/vite-\*
monorepo of plugins created by @uppercod for vite:
### [@uppercod/vite-meta-url](./packages/vite-meta-url/README.md)
replace imports of imported js files within vite, by URL based imports or inline content
```js
import pluginMetaUrl from "@uppercod/vite-meta-url";export default {
build: {
target: "esnext",
},
plugins: [
pluginFileUrl({
/**
* replace the import with a text string based on the return
* @param {string}
* @returns {string|Promise}
*/
css: async (file) => {
return { inline: `.button{color:red;}` };
},
/**
* @param {string} file
* @returns {string|Promise}
*/
svg: async (file) => {
/**any asynchronous optimization of the content**/
return `...`;
},
}),
],
};
```