Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/main/rollup.config.js
Views: 1178
import typescript from '@rollup/plugin-typescript';1import svelte from 'rollup-plugin-svelte';2import resolve from '@rollup/plugin-node-resolve';3import sveltePreprocess from 'svelte-preprocess';4import commonjs from '@rollup/plugin-commonjs';5import metablock from 'rollup-plugin-userscript-metablock';6import fs from 'fs';7import terser from '@rollup/plugin-terser';8import makeBookmarklet from './makeBookmarket.js';910const pkg = JSON.parse(fs.readFileSync('./package.json'));11const full = process.argv.includes('full');1213let output = [14{15file: 'build/bundle.js',16format: 'iife'17}18]1920let otherOutputs = [21{22file: 'build/bundle.user.js',23format: 'iife',24plugins: [25metablock({26file: './meta.json',27override: {28version: pkg.version29}30})31]32},33{34file: 'build/bundle.bookmarklet.txt',35format: 'iife',36plugins: [37terser(),38makeBookmarklet()39]40}41];4243// If we're doing a full build, also create a userscript and bookmarklet44if (full) {45output = output.concat(otherOutputs);46}4748export default {49input: 'src/main.ts',50output,51plugins: [52typescript(),53commonjs(),54svelte({55emitCss: false,56compilerOptions: {57css: 'injected'58},59preprocess: sveltePreprocess()60}),61resolve({62browser: true,63exportConditions: ['svelte'],64extensions: ['.svelte', '.js', '.ts', '.json']65})66]67}6869