This is a modified svelte template, to include the bulma css, which is installed through npm.
There are three options:
First install bulma and a rollup helper plugin:
npm i -D svelte-preprocess node-sass autoprefixer postcss
Go to your rollup.config.js
and apply the following changes:
import svelte from 'rollup-plugin-svelte';
// ....
import sveltePreprocess from 'svelte-preprocess';
export default {
plugins: [
svelte({
preprocess: sveltePreprocess({
sourceMap: !production,
scss: {
includePaths: [
'node_modules',
'src'
]
},
postcss: {
plugins: [require('autoprefixer')()]
}
}),
// other svelte stuff
})
// all other plugins
]
};
Go to your App.svelte
and import the following:
<style global lang="scss">
@import "main.scss";
</style>
And ther you go!
You should now be able to use something like:
<button class="button">Button</button>
Now you should see a nice looking Bulma Button
If you are using VSCode, you should add the following file to make the language-server happy: svelte.config.js
:
const sveltePreprocess = require('svelte-preprocess');
module.exports = {
preprocess: sveltePreprocess(),
}