Skip to content

Commit 872367f

Browse files
committed
chore: Removing (non-functional) setTemplate helper
1 parent 8339fc3 commit 872367f

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

docs/webpack-helpers.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,6 @@ helpers.getPluginsByType(config, webpack.optimize.CommonsChunkPlugin);
118118

119119
Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[PluginWrapper](#pluginwrapper)>**
120120

121-
### setHtmlTemplate
122-
123-
Sets template used by HtmlWebpackPlugin.
124-
125-
**Parameters**
126-
127-
- `config` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** [webpack config](https://webpack.js.org/configuration/#options).
128-
- `template` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** template path. See [HtmlWebpackPlugin docs](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md).
129-
130121
## PluginWrapper
131122

132123
Wrapper around webpack's [plugin](https://webpack.js.org/configuration/plugins/#plugins).

packages/cli/lib/lib/webpack/transform-config.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { resolve } = require('path');
22
const webpack = require('webpack');
3-
const { statSync } = require('fs');
43
const { stat } = require('fs').promises;
54
const { error } = require('../../util');
65

@@ -274,34 +273,6 @@ class WebpackConfigHelpers {
274273
getPluginsByType(config, type) {
275274
return this.getPlugins(config).filter(w => w.plugin instanceof type);
276275
}
277-
278-
/**
279-
* Sets template used by HtmlWebpackPlugin.
280-
*
281-
* @param {object} config - [webpack config](https://webpack.js.org/configuration/#options).
282-
* @param {string} template - template path. See [HtmlWebpackPlugin docs](https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md).
283-
*
284-
* @memberof WebpackConfigHelpers
285-
*/
286-
setHtmlTemplate(config, template) {
287-
let isPath;
288-
try {
289-
statSync(template);
290-
isPath = true;
291-
} catch (e) {}
292-
293-
let templatePath = isPath
294-
? `!!${require.resolve('ejs-loader')}?esModule=false!${resolve(
295-
this._cwd,
296-
template
297-
)}`
298-
: template;
299-
let { plugin: htmlWebpackPlugin } = this.getPluginsByName(
300-
config,
301-
'HtmlWebpackPlugin'
302-
)[0];
303-
htmlWebpackPlugin.options.template = templatePath;
304-
}
305276
}
306277

307278
/**

0 commit comments

Comments
 (0)