Skip to content

Commit 6b0711e

Browse files
authoredAug 4, 2020
fix: fix typos in comments (#1484)
1 parent 6e17a0c commit 6b0711e

7 files changed

+18
-18
lines changed
 

‎index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class HtmlWebpackPlugin {
201201
plugin: self
202202
}))
203203
.then(({ assetTags }) => {
204-
// Inject scripts to body unless it set explictly to head
204+
// Inject scripts to body unless it set explicitly to head
205205
const scriptTarget = self.options.inject === 'head' ? 'head' : 'body';
206206
// Group assets to `head` and `body` tag arrays
207207
const assetGroups = this.generateAssetGroups(assetTags, scriptTarget);
@@ -214,7 +214,7 @@ class HtmlWebpackPlugin {
214214
});
215215
});
216216

217-
// Turn the compiled tempalte into a nodejs function or into a nodejs string
217+
// Turn the compiled template into a nodejs function or into a nodejs string
218218
const templateEvaluationPromise = Promise.resolve()
219219
.then(() => {
220220
if ('error' in templateResult) {
@@ -527,7 +527,7 @@ class HtmlWebpackPlugin {
527527
/**
528528
* @type {string} the configured public path to the asset root
529529
* if a path publicPath is set in the current webpack config use it otherwise
530-
* fallback to a realtive path
530+
* fallback to a relative path
531531
*/
532532
const webpackPublicPath = compilation.mainTemplate.getPublicPath({ hash: compilationHash });
533533
const isPublicPathDefined = webpackPublicPath.trim() !== '';
@@ -585,7 +585,7 @@ class HtmlWebpackPlugin {
585585
if (!asset) {
586586
return true;
587587
}
588-
// Prevent hot-module files from beeing included:
588+
// Prevent hot-module files from being included:
589589
const assetMetaInformation = asset.info || {};
590590
return !(assetMetaInformation.hotModuleReplacement || assetMetaInformation.development);
591591
});
@@ -622,8 +622,8 @@ class HtmlWebpackPlugin {
622622
}
623623

624624
/**
625-
* Converts a favicon file from disk to a webpack ressource
626-
* and returns the url to the ressource
625+
* Converts a favicon file from disk to a webpack resource
626+
* and returns the url to the resource
627627
*
628628
* @param {string|false} faviconFilePath
629629
* @param {WebpackCompilation} compilation

‎lib/cached-child-compiler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CachedChildCompilation {
5858
* @type {WebpackCompiler}
5959
*/
6060
this.compiler = compiler;
61-
// Create a singlton instance for the compiler
61+
// Create a singleton instance for the compiler
6262
// if there is none
6363
if (compilerMap.has(compiler)) {
6464
return;

‎lib/child-compiler.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const LibraryTemplatePlugin = require('webpack/lib/LibraryTemplatePlugin');
1818
const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin');
1919

2020
/**
21-
* The HtmlWebpackChildCompiler is a helper to allow resusing one childCompiler
22-
* for multile HtmlWebpackPlugin instances to improve the compilation performance.
21+
* The HtmlWebpackChildCompiler is a helper to allow reusing one childCompiler
22+
* for multiple HtmlWebpackPlugin instances to improve the compilation performance.
2323
*/
2424
class HtmlWebpackChildCompiler {
2525
/**
@@ -53,14 +53,14 @@ class HtmlWebpackChildCompiler {
5353

5454
/**
5555
* Returns true if the childCompiler is currently compiling
56-
* @retuns {boolean}
56+
* @returns {boolean}
5757
*/
5858
isCompiling () {
5959
return !this.didCompile() && this.compilationStartedTimestamp !== undefined;
6060
}
6161

6262
/**
63-
* Returns true if the childCOmpiler is done compiling
63+
* Returns true if the childCompiler is done compiling
6464
*/
6565
didCompile () {
6666
return this.compilationEndedTimestamp !== undefined;

‎lib/file-watcher-api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22
/**
3-
* To use the availble webpack core api
3+
* To use the available webpack core api
44
* we have to use different child compilers
55
* depending on the used webpack version
66
*/

‎lib/html-tags.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/** @typedef {import("../typings").HtmlTagObject} HtmlTagObject */
33
/**
44
* @file
5-
* This file provides to helper to create html as a object repesentation as
6-
* thoses objects are easier to modify than pure string representations
5+
* This file provides to helper to create html as a object representation as
6+
* those objects are easier to modify than pure string representations
77
*
88
* Usage:
99
* ```

‎spec/basic.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ describe('HtmlWebpackPlugin', () => {
17861786
}, [/<link rel="icon" href="\.\.\/[^"]+\.ico">/], path.join('subfolder', 'test.html'), done);
17871787
});
17881788

1789-
it('adds a favicon with a publichPath set to /[hash]/ and replaces the hash', done => {
1789+
it('adds a favicon with a publicPath set to /[hash]/ and replaces the hash', done => {
17901790
testHtmlPlugin({
17911791
mode: 'production',
17921792
entry: path.join(__dirname, 'fixtures/index.js'),
@@ -1803,7 +1803,7 @@ describe('HtmlWebpackPlugin', () => {
18031803
}, [/<link rel="icon" href="\/[a-z0-9]{20}\/favicon\.ico">/], null, done);
18041804
});
18051805

1806-
it('adds a favicon with a publichPath set to [hash]/ and replaces the hash', done => {
1806+
it('adds a favicon with a publicPath set to [hash]/ and replaces the hash', done => {
18071807
testHtmlPlugin({
18081808
mode: 'production',
18091809
entry: path.join(__dirname, 'fixtures/index.js'),

‎spec/caching.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('HtmlWebpackPluginCaching', () => {
103103
// Verify that no file was built
104104
expect(getCompiledModules(stats.toJson()))
105105
.toEqual([]);
106-
// Verify that the html was processed only during the inital build
106+
// Verify that the html was processed only during the initial build
107107
expect(htmlWebpackPlugin.evaluateCompilationResult.mock.calls.length)
108108
.toBe(1);
109109
// Verify that the child compilation was executed twice
@@ -131,7 +131,7 @@ describe('HtmlWebpackPluginCaching', () => {
131131
// Verify that only one file was built
132132
expect(getCompiledModuleCount(stats.toJson()))
133133
.toBe(1);
134-
// Verify that the html was processed only during the inital build
134+
// Verify that the html was processed only during the initial build
135135
expect(htmlWebpackPlugin.evaluateCompilationResult.mock.calls.length)
136136
.toBe(1);
137137
// Verify that the child compilation was executed only once

0 commit comments

Comments
 (0)
Please sign in to comment.