From 292c7587b0bf6fabdebb94e24bc24c52b0dcdecc Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Thu, 2 Jun 2022 08:24:26 -0500 Subject: Add postcss to sveltePreprocessing --- rollup.config.js | 123 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 63 insertions(+), 60 deletions(-) (limited to 'rollup.config.js') diff --git a/rollup.config.js b/rollup.config.js index 1cf4881..f97c6cc 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,74 +10,77 @@ import css from 'rollup-plugin-css-only'; const production = !process.env.ROLLUP_WATCH; function serve() { - let server; + let server; - function toExit() { - if (server) server.kill(0); - } + function toExit() { + if (server) server.kill(0); + } - return { - writeBundle() { - if (server) return; - server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], { - stdio: ['ignore', 'inherit', 'inherit'], - shell: true - }); + return { + writeBundle() { + if (server) return; + server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], { + stdio: ['ignore', 'inherit', 'inherit'], + shell: true + }); - process.on('SIGTERM', toExit); - process.on('exit', toExit); - } - }; + process.on('SIGTERM', toExit); + process.on('exit', toExit); + } + }; } export default { - input: 'src/main.ts', - output: { - sourcemap: true, - format: 'iife', - name: 'app', - file: 'public/build/bundle.js' - }, - plugins: [ - svelte({ - preprocess: sveltePreprocess({ sourceMap: !production }), - compilerOptions: { - // 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({ output: 'bundle.css' }), + input: 'src/main.ts', + output: { + sourcemap: true, + format: 'iife', + name: 'app', + file: 'public/build/bundle.js' + }, + plugins: [ + svelte({ + preprocess: sveltePreprocess({ + sourceMap: !production, + postcss: true, + }), + compilerOptions: { + // 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({ output: '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/plugins/tree/master/packages/commonjs - resolve({ - browser: true, - dedupe: ['svelte'] - }), - commonjs(), - typescript({ - sourceMap: !production, - inlineSources: !production - }), + // 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/plugins/tree/master/packages/commonjs + resolve({ + browser: true, + dedupe: ['svelte'] + }), + commonjs(), + typescript({ + sourceMap: !production, + inlineSources: !production + }), - // In dev mode, call `npm run start` once - // the bundle has been generated - !production && serve(), + // In dev mode, call `npm run start` once + // the bundle has been generated + !production && serve(), - // Watch the `public` directory and refresh the - // browser on changes when not in production - !production && livereload('public'), + // Watch the `public` directory and refresh the + // browser on changes when not in production + !production && livereload('public'), - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser() - ], - watch: { - clearScreen: false - } + // If we're building for production (npm run build + // instead of npm run dev), minify + production && terser() + ], + watch: { + clearScreen: false + } }; -- cgit v1.2.3 From 982d2cb09f9793fbdfcf8a1d2b2b27e4fd272469 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Fri, 15 Jul 2022 23:18:36 -0400 Subject: Read database from local file for TESTING purposes --- package-lock.json | 34 +++++++++++--- package.json | 1 + rollup.config.js | 6 ++- src/components/Sidebar.svelte | 106 +++++++++++++++++++++++------------------- 4 files changed, 92 insertions(+), 55 deletions(-) (limited to 'rollup.config.js') diff --git a/package-lock.json b/package-lock.json index b5f2182..f2e64c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ }, "devDependencies": { "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-typescript": "^8.3.0", "@smui/button": "^4.2.0", @@ -330,6 +331,18 @@ "rollup": "^2.30.0" } }, + "node_modules/@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.0.8" + }, + "peerDependencies": { + "rollup": "^1.20.0 || ^2.0.0" + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", @@ -2235,9 +2248,9 @@ } }, "node_modules/svelte": { - "version": "3.44.2", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.2.tgz", - "integrity": "sha512-jrZhZtmH3ZMweXg1Q15onb8QlWD+a5T5Oca4C1jYvSURp2oD35h4A5TV6t6MEa93K4LlX6BkafZPdQoFjw/ylA==", + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz", + "integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==", "dev": true, "engines": { "node": ">= 8" @@ -2933,6 +2946,15 @@ "resolve": "^1.17.0" } }, + "@rollup/plugin-json": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8" + } + }, "@rollup/plugin-node-resolve": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", @@ -4320,9 +4342,9 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, "svelte": { - "version": "3.44.2", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.2.tgz", - "integrity": "sha512-jrZhZtmH3ZMweXg1Q15onb8QlWD+a5T5Oca4C1jYvSURp2oD35h4A5TV6t6MEa93K4LlX6BkafZPdQoFjw/ylA==", + "version": "3.49.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.49.0.tgz", + "integrity": "sha512-+lmjic1pApJWDfPCpUUTc1m8azDqYCG1JN9YEngrx/hUyIcFJo6VZhj0A1Ai0wqoHcEIuQy+e9tk+4uDgdtsFA==", "dev": true }, "svelte-check": { diff --git a/package.json b/package.json index 2279014..def4f0a 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "devDependencies": { "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.0.0", "@rollup/plugin-typescript": "^8.3.0", "@smui/button": "^4.2.0", diff --git a/rollup.config.js b/rollup.config.js index f97c6cc..a4ce770 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,6 +6,7 @@ import { terser } from 'rollup-plugin-terser'; import sveltePreprocess from 'svelte-preprocess'; import typescript from '@rollup/plugin-typescript'; import css from 'rollup-plugin-css-only'; +import json from '@rollup/plugin-json'; const production = !process.env.ROLLUP_WATCH; @@ -78,7 +79,10 @@ export default { // If we're building for production (npm run build // instead of npm run dev), minify - production && terser() + production && terser(), + + // Reading from local json should only happen in development - Furkan + !production && json() ], watch: { clearScreen: false diff --git a/src/components/Sidebar.svelte b/src/components/Sidebar.svelte index 53982bb..b5b33c9 100644 --- a/src/components/Sidebar.svelte +++ b/src/components/Sidebar.svelte @@ -1,60 +1,70 @@
- -
- -
- -
Peer Teacher Manager
-
- -
-
- - -
- -
+ +
+ +
+ +
Peer Teacher Manager
+
+ +
- -
- + +
+
+
+ + +
+ +
-- cgit v1.2.3