2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-22 14:48:24 +00:00

Use named export for Svelte component instead of default export

This commit is contained in:
Vjacheslav Trushkin 2021-04-29 19:02:28 +03:00
parent 95ea0e59a6
commit eb2420177d
10 changed files with 15 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
import adminCustomizer from '@iconify-icons/dashicons/admin-customizer'; import adminCustomizer from '@iconify-icons/dashicons/admin-customizer';
import bxUser from '@iconify-icons/bx/bx-user'; import bxUser from '@iconify-icons/bx/bx-user';
import bxError from '@iconify-icons/bx/bx-error'; import bxError from '@iconify-icons/bx/bx-error';

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
import paperclipIcon from '@iconify-icons/dashicons/paperclip'; import paperclipIcon from '@iconify-icons/dashicons/paperclip';
</script> </script>

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
import adminUsers from '@iconify-icons/dashicons/admin-users'; import adminUsers from '@iconify-icons/dashicons/admin-users';
let icon1Style = 'color: purple; vertical-align: 0; font-size: 2em;'; let icon1Style = 'color: purple; vertical-align: 0; font-size: 2em;';

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
const demoIcon = { const demoIcon = {
width: 16, width: 16,

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
import adminCustomizer from '@iconify-icons/dashicons/admin-customizer'; import adminCustomizer from '@iconify-icons/dashicons/admin-customizer';
</script> </script>

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
import paperclipIcon from '@iconify-icons/dashicons/paperclip'; import paperclipIcon from '@iconify-icons/dashicons/paperclip';
const redIcon = 'color: red;'; const redIcon = 'color: red;';

View File

@ -1,5 +1,5 @@
<script> <script>
import Icon from '@iconify/svelte'; import { Icon } from '@iconify/svelte';
import paperclipIcon from '@iconify-icons/dashicons/paperclip'; import paperclipIcon from '@iconify-icons/dashicons/paperclip';
</script> </script>

View File

@ -11,7 +11,7 @@
"url": "https://github.com/iconify/iconify.git", "url": "https://github.com/iconify/iconify.git",
"directory": "packages/svelte" "directory": "packages/svelte"
}, },
"svelte": "dist/Icon.svelte", "svelte": "dist/component.mjs",
"module": "dist/index.mjs", "module": "dist/index.mjs",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {

View File

@ -15,6 +15,12 @@ try {
); );
}); });
// Create component.mjs
fs.writeFileSync(
__dirname + '/dist/component.mjs',
fs.readFileSync(__dirname + '/src/index.js')
);
// Create bundle // Create bundle
const name = pkg.name const name = pkg.name
.replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3') .replace(/^(@\S+\/)?(svelte-)?(\S+)/, '$3')

View File

@ -1 +1 @@
export { default } from './Icon.svelte'; export { default as Icon } from './Icon.svelte';