1.5.1 • Published 2 years ago

@uppercod/vite-meta-url v1.5.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@uppercod/vite-meta-url

resolve a file using url.href in server or build mode when using vite

Example

Config

import pluginMetaUrl from "@uppercod/vite-meta-url";

export default {
    build: {
        target: "esnext",
    },
    plugins: [
        pluginFileUrl({
            jpg: true,
            png: true,
            /**
             * replace the import with a text string based on the return
             * @param {string}
             * @returns {string|Promise<string>}
             */
            css: async (file) => {
                return { inline: `.button{color:red;}` };
            },
            /**
             * @param {string}  file
             * @returns {string|Promise<string>}
             */
            svg: async (file) => {
                /**any asynchronous optimization of the content**/
                return `<svg>...</svg>`;
            },
        }),
    ],
};
1.5.1

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.0

3 years ago