[READ-ONLY] Mirror of https://github.com/mrgnw/mx. Created with CodeSandbox
codesandbox.io/s/github/mrgnw/mx2
1// this file will not afect the sandbox but will
2// afect the deployment and dowload
3
4import svelte from "rollup-plugin-svelte";
5import resolve from "rollup-plugin-node-resolve";
6import commonjs from "rollup-plugin-commonjs";
7import { terser } from "rollup-plugin-terser";
8
9const production = !process.env.ROLLUP_WATCH;
10
11export default {
12 input: "index.js",
13 output: {
14 sourcemap: true,
15 format: "iife",
16 name: "app",
17 file: "public/bundle.js"
18 },
19 plugins: [
20 svelte({
21 // enable run-time checks when not in production
22 dev: !production,
23 // we'll extract any component CSS out into
24 // a separate file — better for performance
25 css: css => {
26 css.write("public/bundle.css");
27 }
28 }),
29
30 // If you have external dependencies installed from
31 // npm, you'll most likely need these plugins. In
32 // some cases you'll need additional configuration —
33 // consult the documentation for details:
34 // https://github.com/rollup/rollup-plugin-commonjs
35 resolve(),
36 commonjs(),
37
38 // If we're building for production (npm run build
39 // instead of npm run dev), minify
40 production && terser()
41 ]
42};