diff --git a/lib/wpwatch.js b/lib/wpwatch.js index aa00a3583..bf60b55ee 100644 --- a/lib/wpwatch.js +++ b/lib/wpwatch.js @@ -43,7 +43,15 @@ module.exports = { }); }); - const compiler = webpack(this.webpackConfig); + const compiler = webpack({ + ...this.webpackConfig, + context: this.serverless.config.servicePath, + output: { + libraryTarget: 'commonjs', + path: this.serverless.config.servicePath+'/.webpack/service', + filename: '[name].js' + } + }); // Determine if we can use hooks or if we should fallback to the plugin api const hasHooks = compiler.hooks && compiler.hooks.beforeCompile;