diff --git a/index.js b/index.js
index 7ab5258f..3a98ca4e 100644
--- a/index.js
+++ b/index.js
@@ -1,15 +1,14 @@
// @ts-check
-'use strict';
-
-// use Polyfill for util.promisify in node versions < v8
-const promisify = require('util.promisify');
-
// Import types
/* eslint-disable */
///
/* eslint-enable */
/** @typedef {import("webpack/lib/Compiler.js")} WebpackCompiler */
/** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */
+'use strict';
+
+// use Polyfill for util.promisify in node versions < v8
+const promisify = require('util.promisify');
const vm = require('vm');
const fs = require('fs');
@@ -33,10 +32,8 @@ class HtmlWebpackPlugin {
*/
constructor (options) {
// Default options
- /**
- * @type {HtmlWebpackPluginOptions}
- */
- this.options = Object.assign({
+ /** @type {HtmlWebpackPluginOptions} */
+ const defaultOptions = {
template: path.join(__dirname, 'default_index.ejs'),
templateContent: false,
templateParameters: templateParametersGenerator,
@@ -54,7 +51,9 @@ class HtmlWebpackPlugin {
meta: {},
title: 'Webpack App',
xhtml: false
- }, options);
+ };
+ /** @type {HtmlWebpackPluginOptions} */
+ this.options = Object.assign(defaultOptions, options);
// Instance variables to keep caching information
// for multiple builds
this.childCompilerHash = undefined;
diff --git a/lib/chunksorter.js b/lib/chunksorter.js
index 53f935ab..d555fbac 100644
--- a/lib/chunksorter.js
+++ b/lib/chunksorter.js
@@ -2,12 +2,6 @@
/** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */
'use strict';
-// Import webpack types using commonjs
-// As we use only the type we have to prevent warnings about unused varaibles
-/* eslint-disable */
-const WebpackCompilation = require('webpack/lib/Compilation');
-/* eslint-enable */
-
/**
* @type {{[sortmode: string] : (entryPointNames: Array, compilation, htmlWebpackPluginOptions) => Array }}
* This file contains different sort methods for the entry chunks names
diff --git a/package.json b/package.json
index d00f82a6..911b124f 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,7 @@
],
"scripts": {
"pretest": "semistandard",
- "posttest": "tsc --pretty",
+ "posttest": "tsc",
"commit": "git-cz",
"build-examples": "node examples/build-examples.js",
"test": "jasmine",
@@ -41,7 +41,7 @@
"semistandard": "8.0.0",
"standard-version": "^4.3.0",
"style-loader": "^0.13.1",
- "typescript": "2.9.0-dev.20180518",
+ "typescript": "2.9.1",
"underscore-template-loader": "^0.7.3",
"url-loader": "^0.5.7",
"webpack": "4.8.3",