about summary refs log tree commit diff
path: root/assets/src/network/channel
AgeCommit message (Collapse)Author
2021-07-31Reregister unregistered token handlers on re-useMelonai
2021-07-14Started better typing for message handlerMelonai
2021-07-08State display for incoming and own requestsMelonai
2021-06-17Share page designMelonai
2021-06-14Make connection independent of typeMelonai
2021-06-13Send over data through channelMelonai
2021-06-04Signaling event processingMelonai
2021-06-04Transfer server APIMelonai
2021-06-03Remove circular channel dependencyMelonai
2021-06-03Dynamic event handling architectureMelonai
2021-06-03Define possible channel messagesMelonai
2021-05-31Socket connection with managed stateMelonai
ight .nx { color: #DDD } /* Name.Other */ .highlight .py { color: #DDD } /* Name.Property */ .highlight .nt { color: #DDD } /* Name.Tag */ .highlight .nv { color: #EEDD82 } /* Name.Variable */ .highlight .ow { color: #F00 } /* Operator.Word */ .highlight .pm { color: #DDD } /* Punctuation.Marker */ .highlight .w { color: #DDD } /* Text.Whitespace */ .highlight .mb { color: #F0F } /* Literal.Number.Bin */ .highlight .mf { color: #F0F } /* Literal.Number.Float */ .highlight .mh { color: #F0F } /* Literal.Number.Hex */ .highlight .mi { color: #F0F } /* Literal.Number.Integer */ .highlight .mo { color: #F0F } /* Literal.Number.Oct */ .highlight .sa { color: #87CEEB } /* Literal.String.Affix */ .highlight .sb { color: #87CEEB } /* Literal.String.Backtick */ .highlight .sc { color: #87CEEB } /* Literal.String.Char */ .highlight .dl { color: #87CEEB } /* Literal.String.Delimiter */ .highlight .sd { color: #87CEEB } /* Literal.String.Doc */ .highlight .s2 { color: #87CEEB } /* Literal.String.Double */ .highlight .se { color: #87CEEB } /* Literal.String.Escape */ .highlight .sh { color: #87CEEB } /* Literal.String.Heredoc */ .highlight .si { color: #87CEEB } /* Literal.String.Interpol */ .highlight .sx { color: #87CEEB } /* Literal.String.Other */ .highlight .sr { color: #87CEEB } /* Literal.String.Regex */ .highlight .s1 { color: #87CEEB } /* Literal.String.Single */ .highlight .ss { color: #87CEEB } /* Literal.String.Symbol */ .highlight .bp { color: #DDD } /* Name.Builtin.Pseudo */ .highlight .fm { color: #FF0 } /* Name.Function.Magic */ .highlight .vc { color: #EEDD82 } /* Name.Variable.Class */ .highlight .vg { color: #EEDD82 } /* Name.Variable.Global */ .highlight .vi { color: #EEDD82 } /* Name.Variable.Instance */ .highlight .vm { color: #EEDD82 } /* Name.Variable.Magic */ .highlight .il { color: #F0F } /* Literal.Number.Integer.Long */
import svelte from "rollup-plugin-svelte";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import { terser } from "rollup-plugin-terser";
import copy from "rollup-plugin-copy";
import sveltePreprocess from "svelte-preprocess";
import typescript from "@rollup/plugin-typescript";
import css from "rollup-plugin-css-only";

const production = !process.env.ROLLUP_WATCH;

export default require("fs")
    .readdirSync("src/entries/")
    .map((file, index) => {
        const name = require("path").parse(file).name;

        return {
            input: `src/entries/${name}.ts`,
            output: {
                format: "iife",
                sourcemap: !production,
                name: name,
                dir: "../priv/static/",
                entryFileNames: "js/[name].js",
            },
            plugins: [
                svelte({
                    preprocess: sveltePreprocess({ sourceMap: !production }),
                    compilerOptions: {
                        // enable run-time checks when not in production
                        dev: !production,
                    },
                }),

                css({ output: `css/${name}.css` }),

                resolve({
                    browser: true,
                    dedupe: ["svelte"],
                }),
                commonjs(),
                typescript({
                    sourceMap: !production,
                    inlineSources: !production,
                }),

                // If we're building for production (npm run build
                // instead of npm run dev), minify
                production && terser(),

				// Copy assets if we haven't yet done so
                index === 0 &&
                    copy({
                        targets: [
                            { src: "public/**/*", dest: "../priv/static" },
                        ],
                    }),
            ],
            watch: {
                clearScreen: false,
            },
        };
    });