1.1.2 • Published 5 years ago

html-webpack-import-static-pages v1.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

HTML webpack import static HTML pages

Dynamically import static HTML pages for HTMLWebpack plugin without having to manually specify every path within your project.

This is an extension to the webpack plugin html-webpack-plugin.

Installation

npm install -D html-webpack-import-static-pages

Plugin requires webpack (v4 or higher), and html-webpack-plugin (v4 or higher - installed as a dependency).

Basic Usage

const HtmlWebpackImportStaticPages = require("html-webpack-import-static-pages");

module.exports = {
	entry: {
		app: path.resolve(__dirname, "src/js/index.js"),
		landing: path.resolve(__dirname, "src/js/views/landing/page-landing.js"),
	},
}

...

plugins: [
    new HtmlWebpackImportStaticPages({
	path: path.resolve(__dirname, 'dev/html'),
        blacklist: ['HTMLPageToBlacklist'],
        chunkAssign: {
            HTMLPageName: ['app', 'landing']
        }
    }),

...
]

Options

NameTypeRequirementsDescription
path{pathname}optionalA path to search for .html files - Defaults to webpack.context/src
blacklistHTMLPageNameoptionalSpecify HTML files to be ignored by HtmlWebPackPlugin
chunkAssignHTMLPageName: chunkoptionalAssign chunks to be included into specific .html pages

Version

v1.1.x

  • Added custom paths

v1.0.x

  • initial release
1.1.2

5 years ago

1.1.1-a

6 years ago

1.1.1

6 years ago

1.1.0-a

6 years ago

1.1.0

6 years ago

1.0.1-b

6 years ago

1.0.1-a

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.0-a

6 years ago