asprouse / serverless-webpack-plugin

Use Webpack to optimize your Serverless Node.js Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Path issue deploying from project root

andreipopovici opened this issue · comments

Hi there,

Deploying from project root using sls dash deploy does not prepend each component's folder to the entry point path (I only have one component called api). Running the same command from within the component's folder works just fine.

Is there anything I'm missing when configuring the plugin? My entry in s-component.json in this case is:

"custom": {
    "webpack": {
      "configPath": "api/webpack.config.js"
    }
  }

I went through the code in bundle.js but couldn't figure out where the issue might be. I'm not very familiar with Serverless plugins and can't figure out where the component's name or folder path would come from.

I see the issue, I'll get working on a fix.

Awesome, please let me know if I can help.

hmmm I get the following error:

ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' ./user-get/index.js in /Users/als/dev/project
Serverless: ------------------------  
Serverless: Failed to deploy the following functions in "dev" to the following regions:  
Serverless: us-east-1 ------------------------  
Serverless:   api/user-get: ENOENT: no such file or directory, open '/Users/als/dev/project/_meta/_tmp/user-get@1458668464870/user-get/index.js' 

It looks like this error is originating in serverless, not the plugin. Is this the same error you are getting?

'Entry module not found ' sounds like a Webpack error. Notice that it's looking for ./user-get from project root, instead of./api/user-get. The component path is not getting appended.

_____________________________

From: Andrew Sprouse notifications@github.com
Sent: Tuesday, March 22, 2016 7:45 PM
Subject: Re: [serverless-webpack-plugin] Path issue deploying from project root (#9)
To: asprouse/serverless-webpack-plugin serverless-webpack-plugin@noreply.github.com
Cc: Andrei Popovici me@andreipopovici.net

hmmm I get the following error: ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' ./user-get/index.js in /Users/als/dev/projectServerless: ------------------------ Serverless: Failed to deploy the following functions in "dev" to the following regions: Serverless: us-east-1 ------------------------ Serverless: api/user-get: ENOENT: no such file or directory, open '/Users/als/dev/project/_meta/_tmp/user-get@1458668464870/user-get/index.js'

It looks like this error is originating in serverless, not the plugin. Is this the same error you are getting?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

Doh you're right. I have a fix I'll push in a few mins

Awesome, thanks! I'll give it a try a bit later, but this should do it.

published to npm also