Skip to content

Commit 0791c5b

Browse files
committed
Making enableTypeScriptLoader() options callback optional
1 parent c5c3d23 commit 0791c5b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,19 @@ module.exports = {
345345
/**
346346
* Call this if you plan on loading TypeScript files.
347347
*
348+
* Encore.enableTypeScriptLoader()
349+
*
350+
* Or, configure the ts-loader options:
351+
*
348352
* Encore.enableTypeScriptLoader(function(tsConfig) {
349-
* // change the tsConfig
353+
* // https://github.com/TypeStrong/ts-loader/blob/master/README.md#loader-options
354+
* // tsConfig.silent = false;
350355
* });
351356
*
352-
* Supported configuration options:
353-
* @see https://github.com/TypeStrong/ts-loader/blob/master/README.md#available-options
354-
*
355357
* @param {function} callback
356358
* @return {exports}
357359
*/
358-
enableTypeScriptLoader(callback) {
360+
enableTypeScriptLoader(callback = () => {}) {
359361
webpackConfig.enableTypeScriptLoader(callback);
360362
},
361363

lib/WebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class WebpackConfig {
226226
this.useReact = true;
227227
}
228228

229-
enableTypeScriptLoader(callback) {
229+
enableTypeScriptLoader(callback = () => {}) {
230230
this.useTypeScriptLoader = true;
231231

232232
if (typeof callback !== 'function') {

0 commit comments

Comments
 (0)