@setoelkahfi / svara / commits / a7aaf79

Removed rollup

mellobacon committed Nov 24, 2022 at 15:05 UTC a7aaf79c994809a4faf597e407cc60e24993b5a5
1 file changed -86
rollup.config.js deleted
-86
@@ -1,86 +0,0 @@
1 -import svelte from 'rollup-plugin-svelte';
2 -import commonjs from '@rollup/plugin-commonjs';
3 -import resolve from '@rollup/plugin-node-resolve';
4 -import livereload from 'rollup-plugin-livereload';
5 -import { terser } from 'rollup-plugin-terser';
6 -import sveltePreprocess from 'svelte-preprocess';
7 -import typescript from '@rollup/plugin-typescript';
8 -import css from 'rollup-plugin-css-only';
9 -import json from '@rollup/plugin-json';
10 -
11 -const production = !process.env.ROLLUP_WATCH;
12 -
13 -function serve() {
14 - let server;
15 -
16 - function toExit() {
17 - if (server) server.kill(0);
18 - }
19 -
20 - return {
21 - writeBundle() {
22 - if (server) return;
23 - server = require('child_process').spawn('yarn', ['start', '--', '--dev'], {
24 - stdio: ['ignore', 'inherit', 'inherit'],
25 - shell: true
26 - });
27 -
28 - process.on('SIGTERM', toExit);
29 - process.on('exit', toExit);
30 - }
31 - };
32 -}
33 -
34 -export default {
35 - input: 'src/main.ts',
36 - output: {
37 - sourcemap: true,
38 - format: 'iife',
39 - name: 'app',
40 - file: 'public/build/bundle.js',
41 - inlineDynamicImports: true
42 - },
43 - plugins: [
44 - svelte({
45 - preprocess: sveltePreprocess({ sourceMap: !production }),
46 - compilerOptions: {
47 - // enable run-time checks when not in production
48 - dev: !production
49 - }
50 - }),
51 - // we'll extract any component CSS out into
52 - // a separate file - better for performance
53 - css({ output: 'bundle.css' }),
54 -
55 - // If you have external dependencies installed from
56 - // npm, you'll most likely need these plugins. In
57 - // some cases you'll need additional configuration -
58 - // consult the documentation for details:
59 - // https://github.com/rollup/plugins/tree/master/packages/commonjs
60 - resolve({
61 - browser: true,
62 - dedupe: ['svelte']
63 - }),
64 - commonjs(),
65 - typescript({
66 - sourceMap: !production,
67 - inlineSources: !production
68 - }),
69 - json(),
70 -
71 - // In dev mode, call `npm run start` once
72 - // the bundle has been generated
73 - !production && serve(),
74 -
75 - // Watch the `public` directory and refresh the
76 - // browser on changes when not in production
77 - !production && livereload('public'),
78 -
79 - // If we're building for production (npm run build
80 - // instead of npm run dev), minify
81 - production && terser()
82 - ],
83 - watch: {
84 - clearScreen: false
85 - }
86 -};