|
2 | 2 |
|
3 | 3 | const BbPromise = require('bluebird'); |
4 | 4 | const _ = require('lodash'); |
5 | | -const path = require('path'); |
6 | 5 |
|
7 | 6 | const validate = require('./lib/validate'); |
8 | 7 | const compile = require('./lib/compile'); |
@@ -108,7 +107,10 @@ class ServerlessWebpack { |
108 | 107 | .then(() => this.serverless.pluginManager.spawn('webpack:package')), |
109 | 108 |
|
110 | 109 | 'before:invoke:local:invoke': () => BbPromise.bind(this) |
111 | | - .then(() => this.serverless.pluginManager.spawn('webpack:validate')) |
| 110 | + .then(() => { |
| 111 | + lib.webpack.isLocal = true; |
| 112 | + return this.serverless.pluginManager.spawn('webpack:validate'); |
| 113 | + }) |
112 | 114 | .then(() => this.serverless.pluginManager.spawn('webpack:compile')) |
113 | 115 | .then(this.prepareLocalInvoke), |
114 | 116 |
|
@@ -158,16 +160,25 @@ class ServerlessWebpack { |
158 | 160 | .then(this.packageModules), |
159 | 161 |
|
160 | 162 | 'before:offline:start': () => BbPromise.bind(this) |
| 163 | + .tap(() => { |
| 164 | + lib.webpack.isLocal = true; |
| 165 | + }) |
161 | 166 | .then(this.prepareOfflineInvoke) |
162 | 167 | .then(this.wpwatch), |
163 | 168 |
|
164 | 169 | 'before:offline:start:init': () => BbPromise.bind(this) |
| 170 | + .tap(() => { |
| 171 | + lib.webpack.isLocal = true; |
| 172 | + }) |
165 | 173 | .then(this.prepareOfflineInvoke) |
166 | 174 | .then(this.wpwatch), |
167 | 175 |
|
168 | 176 | 'before:step-functions-offline:start': () => BbPromise.bind(this) |
169 | | - .then(this.prepareStepOfflineInvoke) |
170 | | - .then(this.compile) |
| 177 | + .tap(() => { |
| 178 | + lib.webpack.isLocal = true; |
| 179 | + }) |
| 180 | + .then(this.prepareStepOfflineInvoke) |
| 181 | + .then(this.compile) |
171 | 182 | }; |
172 | 183 | } |
173 | 184 | } |
|
0 commit comments