Skip to content

Commit da1d871

Browse files
author
Frank Schmid
committed
Switched to "serverless invoke local"
1 parent c7d9cd5 commit da1d871

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

index.js

+7-17
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@ class ServerlessWebpack {
5454
lifecycleEvents: [
5555
'invoke',
5656
],
57-
options: {
58-
function: {
59-
usage: 'Name of the function',
60-
shortcut: 'f',
61-
required: true,
62-
},
63-
path: {
64-
usage: 'Path to JSON file holding input data',
65-
shortcut: 'p',
66-
},
67-
},
6857
},
6958
watch: {
7059
usage: 'Run a function from the webpack output bundle every time the source is changed',
@@ -108,6 +97,10 @@ class ServerlessWebpack {
10897
'after:deploy:createDeploymentArtifacts': () => BbPromise.bind(this)
10998
.then(this.cleanup),
11099

100+
'before:invoke:local:invoke': () => BbPromise.bind(this)
101+
.then(this.validate)
102+
.then(this.compile),
103+
111104
'webpack:validate': () => BbPromise.bind(this)
112105
.then(this.validate),
113106

@@ -116,10 +109,7 @@ class ServerlessWebpack {
116109
.then(this.packExternalModules),
117110

118111
'webpack:invoke:invoke': () => BbPromise.bind(this)
119-
.then(this.validate)
120-
.then(this.compile)
121-
.then(this.run)
122-
.then(out => this.serverless.cli.consoleLog(out)),
112+
.then(() => BbPromise.reject(new this.serverless.classes.Error('Use "serverless invoke local" instead.'))),
123113

124114
'webpack:watch:watch': () => BbPromise.bind(this)
125115
.then(this.validate)
@@ -132,11 +122,11 @@ class ServerlessWebpack {
132122
'before:offline:start': () => BbPromise.bind(this)
133123
.then(this.validate)
134124
.then(this.wpwatch),
135-
125+
136126
'before:offline:start:init': () => BbPromise.bind(this)
137127
.then(this.validate)
138128
.then(this.wpwatch),
139-
129+
140130
};
141131
}
142132
}

0 commit comments

Comments
 (0)