We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export a vite plugin that optimises imports from this library.
// vite.config.ts import { sveltekit } from '@sveltejs/kit/vite'; import { iconImportOptimiser } from 'svelte-bootstrap-icons/vite'; export default defineConfig(() => { return { plugins: [ sveltekit(), iconImportOptimiser(), ] }; });
The plugin would apply the following transformation to svelte and typescript files:
// my-file.js/ts import { Alarm, Bank, CloudMoon } from "svelte-bootstrap-icons";
<script> // MyComponent.svelte import { Alarm, Bank, CloudMoon } from "svelte-bootstrap-icons"; </script>
// my-file.js/ts import Alarm from "svelte-bootstrap-icons/lib/Alarm.svelte"; import Bank from "svelte-bootstrap-icons/lib/Bank.svelte"; import CloudMoon from "svelte-bootstrap-icons/lib/CloudMoon.svelte";
<script> // MyComponent.svelte import Alarm from "svelte-bootstrap-icons/lib/Alarm.svelte"; import Bank from "svelte-bootstrap-icons/lib/Bank.svelte"; import CloudMoon from "svelte-bootstrap-icons/lib/CloudMoon.svelte"; </script>
https://github.com/guybedford/es-module-lexer is a super-fast library for detecting imports (if vite does not provide a simple API for getting them)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's recommended to do direct imports to avoid slow a slow dev-experience, but doing bare imports is so much nicer.
Suggested feature:
Export a vite plugin that optimises imports from this library.
The plugin would apply the following transformation to svelte and typescript files:
From
To
Tip:
https://github.com/guybedford/es-module-lexer is a super-fast library for detecting imports (if vite does not provide a simple API for getting them)
The text was updated successfully, but these errors were encountered: