How to use @rollup/plugin-html - 1 common examples

To help you get started, we’ve selected a few @rollup/plugin-html 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 wellyshen / react-cool-img / rollup / config.js View on Github external
const extensions = ['.js', '.ts', '.tsx', '.json'];
const plugins = [
  resolve({ extensions }),
  commonjs({
    namedExports: {
      react: Object.keys(React),
      'react-dom': Object.keys(ReactDOM)
    }
  }),
  babel({ exclude: 'node_modules/**', extensions }),
  replace({
    'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production')
  }),
  !isLib && url(),
  !isLib && postcss({ extract: true, sourceMap: isDev, minimize: !isDev }),
  !isLib && html({ template }),
  !isLib &&
    copy({
      targets: [
        { src: 'src/static/example_assets', dest: 'src/.dev', rename: 'assets' }
      ]
    }),
  isDev && serve('src/.dev'),
  isDev && livereload(),
  !isDev && terser(),
  !isDev && filesize(),
  isExample &&
    copy({
      targets: [{ src: 'src/.dev', dest: '.', rename: 'example' }],
      hook: 'writeBundle'
    }),
  isLib &&

@rollup/plugin-html

Creates HTML files to serve Rollup bundles

MIT
Latest version published 2 months ago

Package Health Score

95 / 100
Full package analysis

Popular @rollup/plugin-html functions