sapper-blog-template icon indicating copy to clipboard operation
sapper-blog-template copied to clipboard

Updating rollup.config.js and dependencies

Open jigth opened this issue 3 years ago • 0 comments

Hello @Charca,

I just clonned your sapper-blog-template and also deployed it in Netlify, It looks great to me, but I saw a few problems during the installation:

  1. For some package managers such as PNPM and YARN, your current version doesn't run out of the box, but it throws some errors (for npm it starts correctly)

  2. Some dependencies are outdated

that could be solved taking really simple steps (not more than 2 minutes or so).

Proposed solution

  1. Update the version of the "rollup-plugin-svelte" to "6.1.1" (7.0.0 and later didn't work for me with this project)

  2. Add the following attribute to the file rollup.config.js into all the "replace" blocks (located in client, server, serviceWorker)

    preventAssignment: true

The resultant block should look like this

replace({
    preventAssignment: true,
    "process.browser": true,
    "process.env.NODE_ENV": JSON.stringify(mode),
}),
  1. Reinstall node_modules and run npm audit fix to update dependencies

After Following those steps, your blog template is working correctly for the most popular package managers, no warnings, no errors.

If you want, you can check and apply those changes implemented in a repo in my other Github account

jigth avatar Oct 05 '21 20:10 jigth