svelte-element-ui is a element-ui component library base on Svelte.
- Install from npm.
npm install svelte-element-ui
- import the css in svelte file.
<script lang="ts">
import 'svelte-element-ui/lib/seu.css'
import { SeuAside, SeuButton } from 'svelte-element-ui'
</script>
<SeuAside />
<SeuButton>123</SeuButton>
To enable the style effective, rollup-plugin-css-only is needed to add in the rollup.config.js as a plugin.
import css from 'rollup-plugin-css-only';
export default {
...
plugins: [
...
css({ output: 'bundle.css' }),
...
]
...
}
- Copy the font files by using the rollup-plugin-copy in the rollup.config.js as a plugin
import copy from 'rollup-plugin-copy'
export default {
...
plugins: [
...
copy({
targets: [
{
src: [
'node_modules/svelte-element-ui/lib/fonts/element-icons.ttf',
'node_modules/svelte-element-ui/lib/fonts/element-icons.woff',
],
dest: 'public/build/fonts/',
},
],
}),
...
]
...
}
npm run test