Skip to content

Commit

Permalink
Fixed wrong check for TS config after configuration change.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Schmid committed Mar 7, 2018
1 parent 7f1062b commit ce5c02a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ class ServerlessWebpack {
this.options = options;

if (
_.has(this.serverless, 'service.custom.webpack') &&
_.endsWith(this.serverless.service.custom.webpack, '.ts')
(_.has(this.serverless, 'service.custom.webpack') &&
_.isString(this.serverless.service.custom.webpack) &&
_.endsWith(this.serverless.service.custom.webpack, '.ts')) ||
(_.has(this.serverless, 'service.custom.webpack.webpackConfig') &&
_.endsWith(this.serverless.service.custom.webpack.webpackConfig, '.ts'))
) {
require('ts-node/register');
}
Expand Down

0 comments on commit ce5c02a

Please sign in to comment.