Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uppercod/vite


https://github.com/uppercod/vite

Last synced: about 3 hours ago
JSON representation

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 `...`;
},
}),
],
};
```