Skip to content

Commit

Permalink
Making enableTypeScriptLoader() options callback optional
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Jul 2, 2017
1 parent c5c3d23 commit 0791c5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,19 @@ module.exports = {
/**
* Call this if you plan on loading TypeScript files.
*
* Encore.enableTypeScriptLoader()
*
* Or, configure the ts-loader options:
*
* Encore.enableTypeScriptLoader(function(tsConfig) {
* // change the tsConfig
* // https://github.com/TypeStrong/ts-loader/blob/master/README.md#loader-options
* // tsConfig.silent = false;
* });
*
* Supported configuration options:
* @see https://github.com/TypeStrong/ts-loader/blob/master/README.md#available-options
*
* @param {function} callback
* @return {exports}
*/
enableTypeScriptLoader(callback) {
enableTypeScriptLoader(callback = () => {}) {
webpackConfig.enableTypeScriptLoader(callback);
},

Expand Down
2 changes: 1 addition & 1 deletion lib/WebpackConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class WebpackConfig {
this.useReact = true;
}

enableTypeScriptLoader(callback) {
enableTypeScriptLoader(callback = () => {}) {
this.useTypeScriptLoader = true;

if (typeof callback !== 'function') {
Expand Down

0 comments on commit 0791c5b

Please sign in to comment.