How to use rollup-plugin-hot - 2 common examples

To help you get started, we’ve selected a few rollup-plugin-hot 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 sveltech / routify / example / rollup.config.js View on Github external
// instead of npm run dev), minify
    production && terser(),

    // Automatically create missing imported files. This helps keeping
    // the HMR server alive, because Rollup watch tends to crash and
    // hang indefinitely after you've tried to import a missing file.
    hot &&
      autoCreate({
        include: 'src/**/*',
        // Set false to prevent recreating a file that has just been
        // deleted (Rollup watch will crash when you do that though).
        recreate: true,
      }),

    hot &&
      hmr({
        public: 'public',
        inMemory: true,
      }),
  ],
  watch: {
    clearScreen: false,
  },
}

function serve() {
  let started = false
  return {
    name: 'svelte/template:serve',
    writeBundle() {
      if (!started) {
        started = true
github sveltech / routify / example / rollup.config.js View on Github external
// the bundle has been generated
    dev && !nollup && serve({ spa }),

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

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

    // Automatically create missing imported files. This helps keeping
    // the HMR server alive, because Rollup watch tends to crash and
    // hang indefinitely after you've tried to import a missing file.
    hot &&
      autoCreate({
        include: 'src/**/*',
        // Set false to prevent recreating a file that has just been
        // deleted (Rollup watch will crash when you do that though).
        recreate: true,
      }),

    hot &&
      hmr({
        public: 'public',
        inMemory: true,
      }),
  ],
  watch: {
    clearScreen: false,
  },
}

rollup-plugin-hot

> HMR plugin for Rollup, leveraging SystemJS

ISC
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Popular rollup-plugin-hot functions