Skip to content

html-webpack-plugin 4.x - Switching to Webpack 4 api #953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 55 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a0a0f0d
fix(loader): switch to loaderUtils.getOptions
jantimon Mar 20, 2018
22fb03f
fix(chunksorter): Don't sort chunks by default
jantimon Mar 20, 2018
7005a55
fix: Remove compilation.getStats() call for performance reasons
jantimon Mar 22, 2018
47efdea
refactor: Drop support for Webpack 1-3 to use Webpack 4 apis
jantimon Mar 20, 2018
b94e043
fix: Improve perfomance for appcache files
jantimon May 15, 2018
d6b65dd
feat: support ES6 template string in default loader
tommytroylin May 17, 2018
ee6a165
feat(html-tags): Add a helper to create html-tags
jantimon May 15, 2018
a6b8d2d
feat: Use jsdoc for static typing
jantimon May 18, 2018
6ae6f48
feat: Export major version of this plugin
jantimon May 22, 2018
5d3d8e4
feat: Remove selfClosingTag
jantimon May 18, 2018
cc3bf49
fix: Update lodash to 4.17.10
jantimon May 19, 2018
b46bf67
feat: Remove type="text/javascript" from injected script tags
jantimon May 19, 2018
55313be
feat: Simplify <meta> element and charset attribute
jantimon May 19, 2018
37db086
refactor: Change the structure of the internal assets object
jantimon May 19, 2018
342867e
feat: Use webpack 4 entries api to extract asset information
jantimon May 19, 2018
b6dec4b
feat(hooks): Add a helper for easier hook access
jantimon May 21, 2018
1063b04
test: Set typescript to strict mode (noImplicityAny:false)
jantimon May 22, 2018
2439012
chore: Prerelease version 4.0.0
jantimon Jun 3, 2018
c6f0f5a
chore: Upgrade typescript to 2.9
jantimon Jun 3, 2018
f29ae88
feat(compiler): Use a single compiler for multiple plugin instances
jantimon Jun 3, 2018
bbc07a3
feat(compiler): Add file dependencies
jantimon Jun 3, 2018
82b34a1
feat(hooks): Provide static getHook method for access to all html-web…
jantimon Jul 8, 2018
ae1f435
feat: Switch from jasmine to jest
jantimon Jul 9, 2018
d7ec407
feat: Replace jade with pug in examples
jantimon Jul 10, 2018
302e39e
feat: Add default viewport meta tag for default template
jantimon Jul 6, 2018
dfe1d10
fix(tests): Upgrade webpack-recompilation-simulator
jantimon Jul 4, 2018
0ebcd17
feat(compiler): Use timestamps to verify cache validity
jantimon Jun 8, 2018
1422664
fix: Ignore foreign child compilers
jantimon Jun 20, 2018
27c3e72
fix: Add dependencies from the child compilation to the main compilation
jantimon Jul 6, 2018
2123d2a
test: Port tests from ES5 to ES6
jantimon Jul 11, 2018
34d905d
test(hooks): Test the correct hook order execution
jantimon Jul 13, 2018
c1c50b2
test: Add HotModuleReplacement test suite
jantimon Jul 16, 2018
cef1502
refactor(childcompiler): Move fileTimeStampCache out of childCompiler
jantimon Jul 16, 2018
ae8233a
feat: Add support for the [contenthash] placeholder inside htm file n…
jantimon Aug 7, 2018
14b4456
refactor: Changed hook names and arguments - the hook order is 'befor…
jantimon Aug 2, 2018
aede8c1
docs: Add an example with chunk splitting
jantimon Aug 27, 2018
d65b37d
fix: Prevent chunks from beeing added multiple times
jantimon Aug 28, 2018
74774eb
chore(travis): Retry failed tests
jantimon Sep 11, 2018
99f9362
feat: Allow to return async template parameters
jantimon Sep 11, 2018
fb448dd
docs(readme): Add example how to use as peer dependency
jantimon Sep 11, 2018
c920a15
Enable minification by default when 'mode' is production
edmorley Sep 15, 2018
3c97405
Address review comments
edmorley Sep 16, 2018
bdcfe32
docs: Restructure readme
jantimon Sep 11, 2018
6dda46e
docs: Add docs for the meta tag option
jantimon Oct 1, 2018
62e638c
docs(README): add csp-html-webpack-plugin
sibiraj-s Oct 1, 2018
79a0448
perf: migrate from extract-text plugin to mini-css plugin
sibiraj-s Oct 1, 2018
4c11c5d
fix: rename `contenthash` to `templatehash`
sibiraj-s Oct 1, 2018
f4bccb7
revert: restore original filenames in examples
sibiraj-s Oct 1, 2018
dbbdd81
feat: Add publicPath support relative path
Wind4 Oct 3, 2018
8e14a0b
Update index.js
habina Oct 3, 2018
119e817
perf: reject promises with errors
sibiraj-s Sep 28, 2018
049d4d3
fix: allow `contenthash` along with `templatehash`
sibiraj-s Oct 2, 2018
24e4f10
chore: fix typos and remove unnecessary regexp test
sibiraj-s Oct 3, 2018
3934cff
chore: bump dependencies
sibiraj-s Oct 4, 2018
7fb656a
chore: @types/tapable to devDeps (#1076)
AviVahl Oct 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/node_modules/
/dist/
npm-debug.log
/coverage/
npm-debug.*.log
yarn.lock
package-lock.json
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,9 @@ node_js:
- stable
- lts/*
- 6.9
env:
- WEBPACK_VERSION=1 EXTRACT_PLUGIN_VERSION=1
- WEBPACK_VERSION=2 EXTRACT_PLUGIN_VERSION=2
- WEBPACK_VERSION=3 EXTRACT_PLUGIN_VERSION=3.0.0-beta.3
- WEBPACK_VERSION=4.0.0 EXTRACT_PLUGIN_VERSION=4.0.0-alpha.0
before_install:
- stty columns 120
install:
- npm install --ignore-scripts
- npm rm webpack
- npm rm extract-text-webpack-plugin
- npm install webpack@$WEBPACK_VERSION extract-text-webpack-plugin@$EXTRACT_PLUGIN_VERSION --ignore-scripts || true
- travis_retry npm install --ignore-scripts
script:
- npm test
- travis_retry npm test
290 changes: 216 additions & 74 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion default_index.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion docs/template-option.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The version 2.x which was introduced last year (Sep, 2015) changed the way the template is processed.
Instead of forcing all users to use the [blueimp](https://github.com/blueimp/JavaScript-Templates) template engine it allowed to use any webpack loader:

* [jade/pug](https://github.com/pugjs/pug-loader)
* [pug](https://github.com/pugjs/pug-loader)
* [ejs](https://github.com/okonet/ejs-loader)
* [underscore](https://github.com/emaphp/underscore-template-loader)
* [handlebars](https://github.com/pcardune/handlebars-loader)
Expand All @@ -30,6 +30,7 @@ By default (if you don't specify any loader in any way) a [fallback lodash loade
]
}
```

Be aware, using `.html` as your template extention may unexpectedly trigger another loader.

## 2) Setting a loader directly for the template
Expand Down
Binary file not shown.
60 changes: 0 additions & 60 deletions examples/appcache/dist/webpack-1/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/appcache/dist/webpack-1/index.html

This file was deleted.

9 changes: 0 additions & 9 deletions examples/appcache/dist/webpack-1/manifest.appcache

This file was deleted.

Binary file not shown.
86 changes: 0 additions & 86 deletions examples/appcache/dist/webpack-2/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/appcache/dist/webpack-2/index.html

This file was deleted.

9 changes: 0 additions & 9 deletions examples/appcache/dist/webpack-2/manifest.appcache

This file was deleted.

Binary file not shown.
83 changes: 0 additions & 83 deletions examples/appcache/dist/webpack-3/bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/appcache/dist/webpack-3/index.html

This file was deleted.

9 changes: 0 additions & 9 deletions examples/appcache/dist/webpack-3/manifest.appcache

This file was deleted.

3 changes: 0 additions & 3 deletions examples/appcache/dist/webpack-3/styles.css

This file was deleted.

36 changes: 24 additions & 12 deletions examples/appcache/dist/webpack-4/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,34 @@
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
Expand All @@ -73,20 +88,17 @@
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(4);
__webpack_require__(1);
var h1 = document.createElement('h1');
h1.innerHTML = 'Hello world!';
document.body.appendChild(h1);


/***/ }),
/* 1 */,
/* 2 */,
/* 3 */,
/* 4 */
/***/ (function(module, exports) {
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

// removed by extract-text-webpack-plugin
// extracted by mini-css-extract-plugin

/***/ })
/******/ ]);
Loading