New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

html-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-plugin

Create HTML files to serve your webpack bundles

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

HTML Plugin

Here is the plugin mentioned in the offcial webpack guide.

build status coverage npm dependencies

This plugin aims to create index.html for PWAs, with good default template built-in, and let you customize with simple configuration.

You can also provide your own templates in the same way you compose apps - JSX and React components.

Installation

Install the plugin with npm:

$ npm i -D html-plugin vhtml

Usage

Add the plugin to webpack config:

+ const HtmlPlugin = require('html-plugin')
  module.exports = {
    entry: 'index.js',
    output: {
      path: __dirname + '/dist',
      filename: 'bundle.js'
    },
+   plugins: [
+     new HtmlPlugin({
+       title: 'My App'
+     })
+   ]
  }

This will generate dist/index.html:

<!DOCTYPE html>
<html lang="en">

<head>
  <title>My App</title>
  <meta charset="utf-8" />
  <meta name="mobile-web-app-capable" content="yes" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta name="theme-color" content="#000" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <link rel="manifest" href="/manifest.json" />
  <link rel="shortcut icon" href="/favicon.png" />
</head>

<body>
  <div id="root"></div>
  <script src="bundle.js"></script>
</body>

</html>

Options

  • filename
  • title / name
  • lang
  • themeColor
  • manifest
  • favicon

Keywords

webpack

FAQs

Package last updated on 25 Mar 2018

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