svelte-materialize-posts

This proyect is based on the youtube tutorial from @hidjou.

To implement MaterializeCSS in an Svelte3 project, we need to install rollup-plugin-css-only to inject new CSS code coming from another libraries.

On rollup.config.js file we need to include:

plugins: [
    //.....
    css({output: 'public/extra.css'}),
    //.....
    ],

An then in the App.svelte file:

import "../node_modules/materialize-css/dist/css/materialize.min.css";
import "../node_modules/materialize-css/dist/js/materialize.min.js";

Get started

Clone the repo

cd svelte-materialize-posts
npm install

...then start Rollup:

npm run dev

Navigate to localhost:5000. You should see your app running.

Deploying to the web

With now

Install now if you haven't already:

npm install -g now

Then, from within your project folder:

now

As an alternative, use the Now desktop client and simply drag the unzipped project folder to the taskbar icon.

With surge

Install surge if you haven't already:

npm install -g surge

Then, from within your project folder:

npm run build
surge public

Top categories

svelte logo

Want a Svelte site built?

Hire a Svelte developer
Loading Svelte Themes