How to use rollup-plugin-livereload - 10 common examples

To help you get started, we’ve selected a few rollup-plugin-livereload examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github typpo / spacekit / rollup.config.js View on Github external
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import resolve from 'rollup-plugin-node-resolve';
import serve from 'rollup-plugin-serve';

const plugins = [resolve(), commonjs()];

if (process.env.ENABLE_DEV_SERVER) {
  // envar set via `yarn build:watch`
  plugins.push(livereload());
  plugins.push(serve({ port: 8001, contentBase: ['.'] }));
}

export default {
  input: 'src/spacekit.js',
  output: [
    {
      format: 'iife',
      name: 'Spacekit',
      file: 'build/spacekit.js',
    },
  ],
  plugins,
};
github google / blockly-samples / blockly-svelte / rollup.config.js View on Github external
}),

    // If you have external dependencies installed from
    // npm, you'll most likely need these plugins. In
    // some cases you'll need additional configuration —
    // consult the documentation for details:
    // https://github.com/rollup/rollup-plugin-commonjs
    resolve({
      browser: true,
      dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/')
    }),
    commonjs(),

    // Watch the `public` directory and refresh the
    // browser on changes when not in production
    !production && livereload('public'),

    // If we're building for production (npm run build
    // instead of npm run dev), minify
    production && terser()
  ],
  watch: {
    clearScreen: false
  }
};
github fireship-io / 188-firebase-vs-amplify / rollup.config.js View on Github external
css: css => {
				css.write('public/bundle.css');
			}
		}),

		// If you have external dependencies installed from
		// npm, you'll most likely need these plugins. In
		// some cases you'll need additional configuration —
		// consult the documentation for details:
		// https://github.com/rollup/rollup-plugin-commonjs
		resolve(),
		commonjs(),

		// Watch the `public` directory and refresh the
		// browser on changes when not in production
		!production && livereload('public'),

		// If we're building for production (npm run build
		// instead of npm run dev), minify
		production && terser()
	],
	watch: {
		clearScreen: false
	}
};
github domingues / svelte-ssr-example / rollup.config.js View on Github external
hydratable: true,
                emitCss: true
            }),
            css({
                sourcemap: !production,
                chunkFileNames: '[hash].css',
                entryFileNames: '[hash].css'
            }),
            importAssets({
                fileNames: '[hash].[ext]',
                publicPath: publicStaticPath,
            }),
            bundleTree({
                file: 'dist/client-tree.json'
            }),
            !production && livereload({
                watch: 'dist/server',
                delay: 750,
            }),
            production && terser()
        ],
        watch: {
            clearScreen: false
        },
    },
    {
        input: ['src/*.svelte'],
        output: {
            dir: 'dist/server',
            format: 'cjs',
        },
        plugins: [
github neuronetio / gantt-schedule-timeline-calendar / rollup.config.js View on Github external
input: 'src/index.ts',
    output: {
      sourcemap: true,
      file: 'dist/index.umd.js',
      format: 'umd',
      name: 'GSTC'
    },
    //context: 'null',
    //moduleContext: 'null',
    plugins: [
      typescript({ target: 'es6' }),
      resolve({
        browser: true
      }),
      commonjs({ extensions: ['.js', '.ts'] }),
      !production && livereload('dist')
    ]
  },
  {
    input: 'src/index.ts',
    output: {
      sourcemap: true,
      file: 'dist/index.esm.js',
      format: 'esm'
    },
    plugins: [
      typescript({ target: 'es6' }),
      resolve({
        browser: true
      }),
      commonjs({ extensions: ['.js', '.ts'] }),
      production &&
github lukejacksonn / hyperapp-hn / rollup.config.js View on Github external
const dev = !!process.env.ROLLUP_WATCH

export default {
  input: 'src/index.js',
  output: {
    file: 'static/index.js',
    sourcemap: dev ? 'inline' : false,
    format: 'iife',
  },
  plugins: [
    postcss({ plugins: [nested()] }),
    resolve({ jsnext: true }),
    commonjs(),
    buble({ jsx: 'h' }),
    prod && uglify(),
    dev && livereload('static'),
    dev && serve({
      contentBase: ['static'],
      historyApiFallback: true,
      port: 8080,
    })
  ]
}
github ArthurClemens / mithril-slider / scripts / rollup.watch.js View on Github external
output: Object.assign({}, baseConfig.output, {
    file: dest,
    format: "umd",
    sourcemap: false
  })
});

targetConfig.plugins.push(
  serve({
    contentBase: watchDir,
    port: serverPort
  })
);

targetConfig.plugins.push(
  livereload({
    watch: watchDir
  })
);

export default targetConfig;
github tjinauyeung / svelte-forms-lib / rollup.config.docs.js View on Github external
input: "docs-src/index.js",
  output: {
    sourcemap: true,
    format: "iife",
    name: "app",
    file: "docs/bundle.js"
  },
  plugins: [
    svelte(),
    resolve(),
    commonjs(),
    alias({
      resolve: [".svelte", "js"],
      entries: [{ find: "svelte-forms-lib", replacement: path.resolve(__dirname + "/build/index") }]
    }),
    livereload("docs")
  ],
  watch: {
    clearScreen: false
  }
};
github alex996 / project-templates / preact-rollup / rollup.config.js View on Github external
},
  plugins: [
    resolve(),
    copy({
      targets:[
        { src: 'index.html', dest: dist }
      ],
      copyOnce: true
    }),
    development && serve({
      open: true,
      port: 3000,
      contentBase: dist,
      historyApiFallback: true
    }),
    development && livereload({
      watch: dist
    }),
    babel({
      exclude: 'node_modules/**'
    }),
    postcss({
      extract: `${dist}/styles.css`,
      minimize: production
    }),
    production && terser()
  ]
}

rollup-plugin-livereload

Rollup plugin for LiveReload that watches the bundle and reloads the page on change

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis

Popular rollup-plugin-livereload functions