2018-02-10 21:18:00 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
|
|
/**
|
2018-02-27 10:01:10 +02:00
|
|
|
* Special settings for use with serverless-step-functions-offline.
|
2018-02-10 21:18:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
2018-02-20 23:54:46 +02:00
|
|
|
prepareStepOfflineInvoke() {
|
|
|
|
|
_.set(this.serverless, 'service.package.individually', false);
|
2018-02-10 21:18:00 +02:00
|
|
|
|
2018-02-20 23:54:46 +02:00
|
|
|
return this.serverless.pluginManager.spawn('webpack:validate')
|
|
|
|
|
.then(() => {
|
|
|
|
|
if (!this.options.location && !_.get(this.serverless, 'service.custom.stepFunctionsOffline.location')) {
|
|
|
|
|
_.set(this.serverless, 'service.custom.stepFunctionsOffline.location',
|
|
|
|
|
path.relative(this.serverless.config.servicePath, path.join(this.webpackOutputPath, 'service'))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-02-10 21:18:00 +02:00
|
|
|
};
|