Skip to content
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

fix: fix typos in comments #1484

Merged
merged 1 commit into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class HtmlWebpackPlugin {
plugin: self
}))
.then(({ assetTags }) => {
// Inject scripts to body unless it set explictly to head
// Inject scripts to body unless it set explicitly to head
const scriptTarget = self.options.inject === 'head' ? 'head' : 'body';
// Group assets to `head` and `body` tag arrays
const assetGroups = this.generateAssetGroups(assetTags, scriptTarget);
Expand All @@ -214,7 +214,7 @@ class HtmlWebpackPlugin {
});
});

// Turn the compiled tempalte into a nodejs function or into a nodejs string
// Turn the compiled template into a nodejs function or into a nodejs string
const templateEvaluationPromise = Promise.resolve()
.then(() => {
if ('error' in templateResult) {
Expand Down Expand Up @@ -527,7 +527,7 @@ class HtmlWebpackPlugin {
/**
* @type {string} the configured public path to the asset root
* if a path publicPath is set in the current webpack config use it otherwise
* fallback to a realtive path
* fallback to a relative path
*/
const webpackPublicPath = compilation.mainTemplate.getPublicPath({ hash: compilationHash });
const isPublicPathDefined = webpackPublicPath.trim() !== '';
Expand Down Expand Up @@ -585,7 +585,7 @@ class HtmlWebpackPlugin {
if (!asset) {
return true;
}
// Prevent hot-module files from beeing included:
// Prevent hot-module files from being included:
const assetMetaInformation = asset.info || {};
return !(assetMetaInformation.hotModuleReplacement || assetMetaInformation.development);
});
Expand Down Expand Up @@ -622,8 +622,8 @@ class HtmlWebpackPlugin {
}

/**
* Converts a favicon file from disk to a webpack ressource
* and returns the url to the ressource
* Converts a favicon file from disk to a webpack resource
* and returns the url to the resource
*
* @param {string|false} faviconFilePath
* @param {WebpackCompilation} compilation
Expand Down
2 changes: 1 addition & 1 deletion lib/cached-child-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CachedChildCompilation {
* @type {WebpackCompiler}
*/
this.compiler = compiler;
// Create a singlton instance for the compiler
// Create a singleton instance for the compiler
// if there is none
if (compilerMap.has(compiler)) {
return;
Expand Down
8 changes: 4 additions & 4 deletions lib/child-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const LibraryTemplatePlugin = require('webpack/lib/LibraryTemplatePlugin');
const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin');

/**
* The HtmlWebpackChildCompiler is a helper to allow resusing one childCompiler
* for multile HtmlWebpackPlugin instances to improve the compilation performance.
* The HtmlWebpackChildCompiler is a helper to allow reusing one childCompiler
* for multiple HtmlWebpackPlugin instances to improve the compilation performance.
*/
class HtmlWebpackChildCompiler {
/**
Expand Down Expand Up @@ -53,14 +53,14 @@ class HtmlWebpackChildCompiler {

/**
* Returns true if the childCompiler is currently compiling
* @retuns {boolean}
* @returns {boolean}
*/
isCompiling () {
return !this.didCompile() && this.compilationStartedTimestamp !== undefined;
}

/**
* Returns true if the childCOmpiler is done compiling
* Returns true if the childCompiler is done compiling
*/
didCompile () {
return this.compilationEndedTimestamp !== undefined;
Expand Down
2 changes: 1 addition & 1 deletion lib/file-watcher-api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
/**
* To use the availble webpack core api
* To use the available webpack core api
* we have to use different child compilers
* depending on the used webpack version
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/html-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/** @typedef {import("../typings").HtmlTagObject} HtmlTagObject */
/**
* @file
* This file provides to helper to create html as a object repesentation as
* thoses objects are easier to modify than pure string representations
* This file provides to helper to create html as a object representation as
* those objects are easier to modify than pure string representations
*
* Usage:
* ```
Expand Down
4 changes: 2 additions & 2 deletions spec/basic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ describe('HtmlWebpackPlugin', () => {
}, [/<link rel="icon" href="\.\.\/[^"]+\.ico">/], path.join('subfolder', 'test.html'), done);
});

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

it('adds a favicon with a publichPath set to [hash]/ and replaces the hash', done => {
it('adds a favicon with a publicPath set to [hash]/ and replaces the hash', done => {
testHtmlPlugin({
mode: 'production',
entry: path.join(__dirname, 'fixtures/index.js'),
Expand Down
4 changes: 2 additions & 2 deletions spec/caching.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('HtmlWebpackPluginCaching', () => {
// Verify that no file was built
expect(getCompiledModules(stats.toJson()))
.toEqual([]);
// Verify that the html was processed only during the inital build
// Verify that the html was processed only during the initial build
expect(htmlWebpackPlugin.evaluateCompilationResult.mock.calls.length)
.toBe(1);
// Verify that the child compilation was executed twice
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('HtmlWebpackPluginCaching', () => {
// Verify that only one file was built
expect(getCompiledModuleCount(stats.toJson()))
.toBe(1);
// Verify that the html was processed only during the inital build
// Verify that the html was processed only during the initial build
expect(htmlWebpackPlugin.evaluateCompilationResult.mock.calls.length)
.toBe(1);
// Verify that the child compilation was executed only once
Expand Down