File tree 3 files changed +11
-18
lines changed
3 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 1
1
// @ts -check
2
- 'use strict' ;
3
-
4
- // use Polyfill for util.promisify in node versions < v8
5
- const promisify = require ( 'util.promisify' ) ;
6
-
7
2
// Import types
8
3
/* eslint-disable */
9
4
/// <reference path="./typings.d.ts" />
10
5
/* eslint-enable */
11
6
/** @typedef {import("webpack/lib/Compiler.js") } WebpackCompiler */
12
7
/** @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' ) ;
13
12
14
13
const vm = require ( 'vm' ) ;
15
14
const fs = require ( 'fs' ) ;
@@ -33,10 +32,8 @@ class HtmlWebpackPlugin {
33
32
*/
34
33
constructor ( options ) {
35
34
// Default options
36
- /**
37
- * @type {HtmlWebpackPluginOptions }
38
- */
39
- this . options = Object . assign ( {
35
+ /** @type {HtmlWebpackPluginOptions } */
36
+ const defaultOptions = {
40
37
template : path . join ( __dirname , 'default_index.ejs' ) ,
41
38
templateContent : false ,
42
39
templateParameters : templateParametersGenerator ,
@@ -54,7 +51,9 @@ class HtmlWebpackPlugin {
54
51
meta : { } ,
55
52
title : 'Webpack App' ,
56
53
xhtml : false
57
- } , options ) ;
54
+ } ;
55
+ /** @type {HtmlWebpackPluginOptions } */
56
+ this . options = Object . assign ( defaultOptions , options ) ;
58
57
// Instance variables to keep caching information
59
58
// for multiple builds
60
59
this . childCompilerHash = undefined ;
Original file line number Diff line number Diff line change 2
2
/** @typedef {import("webpack/lib/Compilation.js") } WebpackCompilation */
3
3
'use strict' ;
4
4
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
-
11
5
/**
12
6
* @type {{[sortmode: string] : (entryPointNames: Array<string>, compilation, htmlWebpackPluginOptions) => Array<string> } }
13
7
* This file contains different sort methods for the entry chunks names
Original file line number Diff line number Diff line change 12
12
],
13
13
"scripts" : {
14
14
"pretest" : " semistandard" ,
15
- "posttest" : " tsc --pretty " ,
15
+ "posttest" : " tsc" ,
16
16
"commit" : " git-cz" ,
17
17
"build-examples" : " node examples/build-examples.js" ,
18
18
"test" : " jasmine" ,
41
41
"semistandard" : " 8.0.0" ,
42
42
"standard-version" : " ^4.3.0" ,
43
43
"style-loader" : " ^0.13.1" ,
44
- "typescript" : " 2.9.0-dev.20180518 " ,
44
+ "typescript" : " 2.9.1 " ,
45
45
"underscore-template-loader" : " ^0.7.3" ,
46
46
"url-loader" : " ^0.5.7" ,
47
47
"webpack" : " 4.8.3" ,
You can’t perform that action at this time.
0 commit comments