html-elements-webpack-plugin
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
## 1.0.0 - 2016-11-26 | ||
## 1.0.1 - 2016-11-26 | ||
- initial release | ||
## 1.0.0 - 2016-11-26 | ||
- pre-release | ||
## 0.0.1 - 2016-11-26 | ||
- pre-release |
@@ -1,6 +0,6 @@ | ||
function HtmlElementsPlugin(locations) { | ||
function HtmlElementsWebpackPlugin(locations) { | ||
this.locations = locations; | ||
} | ||
HtmlElementsPlugin.prototype.apply = function(compiler) { | ||
HtmlElementsWebpackPlugin.prototype.apply = function (compiler) { | ||
var self = this; | ||
@@ -114,2 +114,2 @@ compiler.plugin('compilation', | ||
module.exports = HtmlElementsPlugin; | ||
module.exports = HtmlElementsWebpackPlugin; |
{ | ||
"name": "html-elements-webpack-plugin", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Webpack plugin to append head elements during the creation of index.html", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,3 @@ | ||
# html-elements-webpack-plugin [](http://badge.fury.io/js/html-elements-webpack-plugin) [](https://npmjs.org/html-elements-webpack-plugin) | ||
# html-elements-webpack-plugin | ||
[](http://badge.fury.io/js/html-elements-webpack-plugin) [](https://npmjs.org/html-elements-webpack-plugin) | ||
@@ -68,3 +69,3 @@ This repository holds the JavaScript source code and distributable bundle of **`html-elements-webpack-plugin`**, the webpack plugin to append head elements during the creation of `index.html` with the source code is copied from [AngularClass/angular2-webpack-starter](https://github.com/AngularClass/angular2-webpack-starter). | ||
```JavaScript | ||
const HtmlElementsPlugin = require('html-elements-webpack-plugin'); | ||
const HtmlElementsWebpackPlugin = require('html-elements-webpack-plugin'); | ||
@@ -76,3 +77,3 @@ module.exports = { | ||
/* | ||
* Plugin: HtmlElementsPlugin | ||
* Plugin: HtmlElementsWebpackPlugin | ||
* Description: Generate html tags based on javascript maps. | ||
@@ -89,3 +90,3 @@ * | ||
* Adding this plugin configuration | ||
* new HtmlElementsPlugin({ | ||
* new HtmlElementsWebpackPlugin({ | ||
* headTags: { ... } | ||
@@ -99,3 +100,3 @@ * }) | ||
*/ | ||
new HtmlElementsPlugin({ | ||
new HtmlElementsWebpackPlugin({ | ||
headTags: require('./head-config') | ||
@@ -109,2 +110,22 @@ }), | ||
#### index.html | ||
```html | ||
<!DOCTYPE html> | ||
<head> | ||
<base href="/"> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta content="width=device-width, initial-scale=1" name="viewport" /> | ||
<% if (webpackConfig.htmlElements.headTags) { %> | ||
<!-- Configured Head Tags --> | ||
<%= webpackConfig.htmlElements.headTags %> | ||
<% } %> | ||
</head> | ||
<body> | ||
<main>Loading...</main> | ||
</body> | ||
</html> | ||
``` | ||
Awesome! **`html-elements-webpack-plugin`** will now append the head elements specified in `head-config.js` during the creation of `index.html`: | ||
@@ -111,0 +132,0 @@ |
11610
131