https://serverless-stack.com/ logo
#sst
Title
# sst
t

thdxr

07/15/2021, 3:54 PM
Is there a way to specify looking in a different folder instead of
lib
with sst.json
j

Jay

07/15/2021, 5:38 PM
Not yet but a couple of folks have requested it so far https://github.com/serverless-stack/serverless-stack/discussions/180
g

geekmidas

07/15/2021, 7:41 PM
@Jay I’m happy to take this one on.
j

Jay

07/15/2021, 8:28 PM
@geekmidas Thank you! Let me pull @Frank in here. He might have something for you 😉
f

Frank

07/15/2021, 9:45 PM
Should we let ppl specify the path in
sst.json
?
Copy code
{
  "name": "playground",
  "stage": "dev",
  "region": "us-east-1",
  "path_to_stack_definition": "lib"
}
If so, what should we we call this field?
Just talked to Jay, let’s name the field
main"
, and it points to the
index.js
file. So
sst.json
would look like this:
Copy code
{
  "name": "playground",
  "stage": "dev",
  "region": "us-east-1",
  "main": "infra/index.js"
}
@geekmidas I opened an issue here if you want to take a crack at it https://github.com/serverless-stack/serverless-stack/issues/553
g

geekmidas

07/16/2021, 9:41 PM
I started working on this and I can see that the
lib/
is being created in the
.build
when running the tests. I am struggling to find where this is being done, anyone free to help? @Frank @Jay
@Jay correct me if i’m wrong
j

Jay

07/16/2021, 10:15 PM
That is the file where we first read from the
lib
dir. Is that what you were looking for @geekmidas?
g

geekmidas

07/17/2021, 8:26 AM
Not really @Jay, it seems to me you are currently building the
lib/
and having the result of that moved to
.build/
I'm not sure where that is happening I made the change to look for the
main
inside
sst.json
, the issue I'm having now is the fact that my
infra/index.js
is using
ES6
imports and they can't be resolved in that context. Meaning I am missing some build step.
j

Jay

07/17/2021, 9:42 PM
g

geekmidas

07/18/2021, 5:25 AM
@Jay Thanks, I will add the feature before end of day.
@Jay @Frank The PR is out, but it failed the label check. Should we not add that to the contribution guide? About how to create a PR into the project?
f

Frank

07/19/2021, 8:01 AM
Awesome! Thanks @geekmidas! I will take a look at the PR today or tmr.
Good point on the contribution guide. I created an issue to update the contribution guide, and assigned it to @Jay - https://github.com/serverless-stack/serverless-stack/projects/1#card-65230812
@thdxr this is now possible in v0.35.0 by specifying the path to the app file in `sst.json`:
Copy code
{
  "name": "my-sst-app",
  "stage": "dev",
  "region": "us-east-1",
  "main": "infra/index.js"
}
t

thdxr

07/21/2021, 10:41 AM
Amazing thank you