You've already forked serverless-webpack
mirror of
https://github.com/encounter/serverless-webpack.git
synced 2026-03-30 11:37:58 -07:00
28 lines
747 B
JavaScript
28 lines
747 B
JavaScript
'use strict';
|
|
|
|
const _ = require('lodash');
|
|
const path = require('path');
|
|
|
|
/**
|
|
* Special settings for use with serverless-offline.
|
|
*/
|
|
|
|
module.exports = {
|
|
prepareOfflineInvoke() {
|
|
|
|
// Use service packaging for compile
|
|
_.set(this.serverless, 'service.package.individually', false);
|
|
|
|
return this.validate()
|
|
.then(() => {
|
|
// Set offline location automatically if not set manually
|
|
if (!this.options.location && !_.get(this.serverless, 'service.custom.serverless-offline.location')) {
|
|
_.set(this.serverless, 'service.custom.serverless-offline.location',
|
|
path.relative(this.serverless.config.servicePath, path.join(this.webpackOutputPath, 'service'))
|
|
);
|
|
}
|
|
return null;
|
|
});
|
|
}
|
|
};
|