Skip to content

Commit c6f0f5a

Browse files
committed
chore: Upgrade typescript to 2.9
1 parent 2439012 commit c6f0f5a

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

index.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// @ts-check
2-
'use strict';
3-
4-
// use Polyfill for util.promisify in node versions < v8
5-
const promisify = require('util.promisify');
6-
72
// Import types
83
/* eslint-disable */
94
/// <reference path="./typings.d.ts" />
105
/* eslint-enable */
116
/** @typedef {import("webpack/lib/Compiler.js")} WebpackCompiler */
127
/** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */
8+
'use strict';
9+
10+
// use Polyfill for util.promisify in node versions < v8
11+
const promisify = require('util.promisify');
1312

1413
const vm = require('vm');
1514
const fs = require('fs');
@@ -33,10 +32,8 @@ class HtmlWebpackPlugin {
3332
*/
3433
constructor (options) {
3534
// Default options
36-
/**
37-
* @type {HtmlWebpackPluginOptions}
38-
*/
39-
this.options = Object.assign({
35+
/** @type {HtmlWebpackPluginOptions} */
36+
const defaultOptions = {
4037
template: path.join(__dirname, 'default_index.ejs'),
4138
templateContent: false,
4239
templateParameters: templateParametersGenerator,
@@ -54,7 +51,9 @@ class HtmlWebpackPlugin {
5451
meta: {},
5552
title: 'Webpack App',
5653
xhtml: false
57-
}, options);
54+
};
55+
/** @type {HtmlWebpackPluginOptions} */
56+
this.options = Object.assign(defaultOptions, options);
5857
// Instance variables to keep caching information
5958
// for multiple builds
6059
this.childCompilerHash = undefined;

lib/chunksorter.js

-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
/** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */
33
'use strict';
44

5-
// Import webpack types using commonjs
6-
// As we use only the type we have to prevent warnings about unused varaibles
7-
/* eslint-disable */
8-
const WebpackCompilation = require('webpack/lib/Compilation');
9-
/* eslint-enable */
10-
115
/**
126
* @type {{[sortmode: string] : (entryPointNames: Array<string>, compilation, htmlWebpackPluginOptions) => Array<string> }}
137
* This file contains different sort methods for the entry chunks names

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"scripts": {
1414
"pretest": "semistandard",
15-
"posttest": "tsc --pretty",
15+
"posttest": "tsc",
1616
"commit": "git-cz",
1717
"build-examples": "node examples/build-examples.js",
1818
"test": "jasmine",
@@ -41,7 +41,7 @@
4141
"semistandard": "8.0.0",
4242
"standard-version": "^4.3.0",
4343
"style-loader": "^0.13.1",
44-
"typescript": "2.9.0-dev.20180518",
44+
"typescript": "2.9.1",
4545
"underscore-template-loader": "^0.7.3",
4646
"url-loader": "^0.5.7",
4747
"webpack": "4.8.3",

0 commit comments

Comments
 (0)