Socket
Book a DemoInstallSign in
Socket

@reactway/webpack-builder-plugin-html

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reactway/webpack-builder-plugin-html

A plugin made for webpack-builder.

latest
Source
npmnpm
Version
2.0.4
Version published
Weekly downloads
2
-50%
Maintainers
3
Weekly downloads
 
Created
Source

@reactway/webpack-builder-plugin-html

A plugin made for webpack-builder.

Getting started

$ npm i @reactway/webpack-builder-plugin-html

Add plugin into webpack config by using use() builder method.

const webpackBuilder = require("@reactway/webpack-builder");
const htmlPlugin = require("@reactway/webpack-builder-plugin-html");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
})
    .use(htmlPlugin)
    .toConfig();

Passing options

Default webpack-builder-plugin-html options and we are also using base html-webpack-template template (HtmlWebpackTemplate named value):

let htmlPluginOptions: HtmlWebpackPlugin.Options | undefined = {
    inject: false,
    template: HtmlWebpackTemplate,
    baseHref: "/",
    appMountIds: ["root"],
    meta: [
        {
            name: "viewport",
            content: "width=device-width, initial-scale=1"
        }
    ]
};

By giving any option it will fully override default options. It is wrapped html-webpack-plugin. All options you can pass from the wrapped package.

const webpackBuilder = require("@reactway/webpack-builder");
const htmlPlugin = require("@reactway/webpack-builder-plugin-html");

module.exports = new webpackBuilder.Builder(__dirname, {
    entry: "./src/app.js",
    output: {
        path: "./dist",
        filename: "[name].bundle.js"
    }
})
    .use(htmlPlugin, {
        title: 'Custom template',
        template: 'index.html',
        ...
    }})
    .toConfig();

Documentation

WIP

License

Released under the MIT license.

Keywords

webpack

FAQs

Package last updated on 20 Feb 2020

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