Advertisement
Guest User

Untitled

a guest
Apr 19th, 2020
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.70 KB | None
  1. import svelte from 'rollup-plugin-svelte';
  2. import resolve from '@rollup/plugin-node-resolve';
  3. import commonjs from '@rollup/plugin-commonjs';
  4. // import autoPreprocess from 'svelte-preprocess';
  5. import postcss from 'rollup-plugin-postcss';
  6. // import livereload from 'rollup-plugin-livereload';
  7. import { terser } from 'rollup-plugin-terser';
  8.  
  9. const production = !process.env.ROLLUP_WATCH;
  10.  
  11. export default {
  12.   input: 'js/main.js',
  13.   output: {
  14.     sourcemap: true,
  15.     format: 'iife',
  16.     name: 'app',
  17.     file: '../priv/static/js/app.js'
  18.   },
  19.   plugins: [
  20.     postcss(),
  21.  
  22.     svelte({
  23.       // preprocess: autoPreprocess(),
  24.       // enable run-time checks when not in production
  25.       dev: !production,
  26.       // we'll extract any component CSS out into
  27.       // a separate file - better for performance
  28.       css: css => {
  29.         css.write('../priv/static/css/app.css');
  30.       }
  31.     }),
  32.  
  33.     // If you have external dependencies installed from
  34.     // npm, you'll most likely need these plugins. In
  35.     // some cases you'll need additional configuration -
  36.     // consult the documentation for details:
  37.     // https://github.com/rollup/plugins/tree/master/packages/commonjs
  38.     resolve({
  39.       browser: true,
  40.       dedupe: ['svelte']
  41.     }),
  42.     commonjs(),
  43.  
  44.     // In dev mode, call `npm run start` once
  45.     // the bundle has been generated
  46.     // !production && serve(),
  47.  
  48.     // Watch the `public` directory and refresh the
  49.     // browser on changes when not in production
  50.     // !production && livereload('public'),
  51.  
  52.     // If we're building for production (npm run build
  53.     // instead of npm run dev), minify
  54.     production && terser()
  55.   ],
  56.   watch: {
  57.     clearScreen: false
  58.   }
  59. };
Advertisement
RAW Paste Data Copied
Advertisement