-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for integrating html-webpack-plugin #49
- Loading branch information
Showing
9 changed files
with
97 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rules": { | ||
"strict": 0, | ||
"import/no-extraneous-dependencies": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# templates | ||
|
||
This directory contains templates that are used to build the HTML | ||
files that Webpack will use to run or create the served pages. | ||
|
||
## html-webpack-plugin | ||
|
||
Templates are created via | ||
[html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin). | ||
All its features (cache hashes, various templating languages, ...) | ||
are available to customize and extend template behavior. | ||
|
||
## Configuration | ||
|
||
The entry point for configuring the plugin is in `conf/webpack/Base.js`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- | ||
@file This is the main template file that will be transformed to the index.html when running Webpack. | ||
See `conf/Base.js` for its initial configuration values. You can modify these to achieve customized template logic. | ||
Additional supported settings: | ||
- {string} lang specifies the language of the content | ||
--> | ||
<!DOCTYPE html> | ||
<html lang="<%= htmlWebpackPlugin.options.lang || 'en' %>"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title><%= htmlWebpackPlugin.options.title || 'Generator React Webpack'%></title> | ||
|
||
<link rel="icon" type="image/x-icon" href="/static/favicon.ico" /> | ||
|
||
<% for (var css in htmlWebpackPlugin.files.css) { %> | ||
<link href="<%= htmlWebpackPlugin.files.css[css] %>" rel="stylesheet"> | ||
<% } %> | ||
|
||
</head> | ||
<body> | ||
|
||
<% if (htmlWebpackPlugin.options.appMountId) { %> | ||
<div id="<%= htmlWebpackPlugin.options.appMountId%>"></div> | ||
<% } %> | ||
|
||
<% if (htmlWebpackPlugin.options.appMountIds && htmlWebpackPlugin.options.appMountIds.length > 0) { %> | ||
<% for (var index in htmlWebpackPlugin.options.appMountIds) { %> | ||
<div id="<%= htmlWebpackPlugin.options.appMountIds[index]%>"></div> | ||
<% } %> | ||
<% } %> | ||
|
||
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %> | ||
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script> | ||
<% } %> | ||
|
||
</body> | ||
</html> |