Socket
Book a DemoInstallSign in
Socket

@beyonk/rollup-plugin-html-esm

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/rollup-plugin-html-esm

Generates html for modular ECMAScript

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
3
-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

@beyonk/rollup-plugin-generate-html-esm

js-standard-style CircleCI

Simple rollup plugin to generate html file and inject your output module into it. Supports ES Modules / Code-splitting. Currently html file will be placed in same directory as the output file. This plugin is inspired from rollup-plugin-generate-html.

Installation

npm install --save-dev @beyonk/rollup-plugin-html-esm

Usage

import html from '@beyonk/rollup-plugin-html-esm'

export default [{
  input: 'main.js',
  output: {
    file: 'bundle.js',
    format: 'umd'
  },
  plugins: [
    html({
      // specify template html (optional)
      template: './index.html',  // Default undefined
      // output filename (optional)
      filename: 'some.html', // Default index.html
      // when specified, js src will use absolute path from publicPath (optional)
      publicPath: 'dist' // Default undefined
    })
  ]
}]

Advanced usage

For cases when you want to generate html file per output. This should come in handy when you want to generate book example codes and such.

import glob from 'glob'
import html from '@beyonk/rollup-plugin-html-es'

const configs = glob
  .sync('src/**/index.js')
  .map(input => ({
    input,
    output: [{ file: input.replace(/^src/, 'dist'), format: 'umd' }],
    plugins: [html()],
  }))

export default configs

Keywords

rollup

FAQs

Package last updated on 22 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts