Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
"start": "sirv public",
"validate": "svelte-check"
},
"pre-commit": [ "validate", "build" ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need pre-commit as a dependency? What's it offering for the boilerplate?

"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-typescript": "^8.0.0",
"@tsconfig/svelte": "^1.0.0",
"pre-commit": "^1.2.2",
"rollup": "^2.3.4",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-livereload": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/build/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import App from './App.svelte';

// You can define default input values here. The values here will be used if no value is given.
const inputs = {
...{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining an object and then instantly spreading it seems a bit dank. Couldn't we just do?

const props = {
  foo: 'bar',
   ...window.templateProps
}

headline: 'Hello World',
showLogos: true,
backgroundImage: ''
},
...window.templateProps
}

const app = new App({
target: document.body,
props: {
templateProps: window.templateProps || {
headline: 'Hello World',
showLogos: true,
backgroundImage: ''
}
templateProps: inputs
}
});

Expand Down