diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..afd95ac --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# http://editorconfig.org +root = true + +[*] +indent_size = 4 +indent_style = space +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false diff --git a/ui/.gitignore b/ui/.gitignore new file mode 100644 index 0000000..b21668d --- /dev/null +++ b/ui/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +node_modules +package-lock.json +yarn.lock +public diff --git a/ui/package.json b/ui/package.json new file mode 100644 index 0000000..af12750 --- /dev/null +++ b/ui/package.json @@ -0,0 +1,26 @@ +{ + "private": true, + "name": "svelte-demo", + "scripts": { + "build": "rollup -c", + "autobuild": "rollup -c -w", + "dev": "run-p start:dev autobuild", + "start": "sirv public --single", + "start:dev": "sirv public --dev --single" + }, + "dependencies": { + "ganalytics": "^3.1.2", + "navaid": "^1.0.2" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^15.0.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-replace": "^2.3.0", + "npm-run-all": "^4.1.3", + "rollup": "^2.30.0", + "rollup-plugin-svelte": "^6.0.0", + "rollup-plugin-terser": "^7.0.0", + "sirv-cli": "^1.0.8", + "svelte": "^3.4.4" + } +} diff --git a/ui/public/global.css b/ui/public/global.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ui/public/global.css @@ -0,0 +1 @@ + diff --git a/ui/public/index.html b/ui/public/index.html new file mode 100644 index 0000000..37ebdc0 --- /dev/null +++ b/ui/public/index.html @@ -0,0 +1,19 @@ + + + + + + + + + Svelte app + + + + + + + + + + diff --git a/ui/rollup.config.js b/ui/rollup.config.js new file mode 100644 index 0000000..c05a512 --- /dev/null +++ b/ui/rollup.config.js @@ -0,0 +1,49 @@ +import svelte from 'rollup-plugin-svelte'; +import replace from '@rollup/plugin-replace'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import { terser } from 'rollup-plugin-terser'; + +const production = !process.env.ROLLUP_WATCH; + +export default { + input: 'src/index.js', + output: { + name: 'app', + format: 'esm', + sourcemap: true, + dir: 'public', + }, + preserveEntrySignatures: false, + plugins: [ + svelte({ + // enable run-time checks when not in production + dev: !production, + // we'll extract any component CSS out into + // a separate file — better for performance + css: css => { + css.write('bundle.css'); + } + }), + + // If you have external dependencies installed from + // npm, you'll most likely need these plugins. In + // some cases you'll need additional configuration — + // consult the documentation for details: + // https://github.com/rollup/rollup-plugin-commonjs + resolve(), + commonjs(), + + replace({ + 'process.env.NODE_ENV': JSON.stringify(production ? 'production' : 'development') + }), + + // If we're building for production (npm run build + // instead of npm run dev), minify + production && terser() + ], + + watch: { + clearScreen: false + } +};