Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Serverless Package and final artifact #11

Closed
romainquellec opened this issue Mar 19, 2019 · 8 comments
Closed

Serverless Package and final artifact #11

romainquellec opened this issue Mar 19, 2019 · 8 comments

Comments

@romainquellec
Copy link

With my current project : https://github.com/CuistotduCoin/front

If I do this : serverless package
In .serverless/serverless-ssr.zip contain everything in the directory. I think it should only contain "sls-next-build". This is a bug, right ?

If not, what I'm doing wrong ?

@danielcondemarin
Copy link
Contributor

Excluding stuff is up to the user. The plugin only makes sure that the page handlers are always included.

I would normally exclude everything, for example:

plugins:
  - serverless-nextjs-plugin

custom:
  serverless-nextjs:
    nextConfigDir: "./"

package:
  exclude:
    - ./**/*

@romainquellec
Copy link
Author

romainquellec commented Mar 19, 2019

@romainquellec
Copy link
Author

romainquellec commented Mar 20, 2019

Right now, .serverless/serverless-ssr.zip is 226 Mo. This should be around 50 Mo with only Lambda
I'm almost at the limit fixed by AWS.

@romainquellec
Copy link
Author

romainquellec commented Mar 20, 2019

What I did, (i dont know if this is correct) :

package:
  exclude:
    - ./**
  include:
    - .serverless/**`
    - ./build

EDIT : Nope, what I did is :

package:
  exclude:
    - ./**

@danielcondemarin
Copy link
Contributor

Seems to work fine for me:

image

serverless-ssr.zip is 30M, mostly the page bundles generated by next.

If you unzip serverless-ssr.zip what do you get?

@romainquellec
Copy link
Author

On windows :

package:
  exclude:
    - ./**

I get exactly your result.
But with :

package:
  exclude:
    - ./**/*

I get everything (build, pages, components, .serverless, ect)

@danielcondemarin
Copy link
Contributor

I've updated the docs and examples to use ./** as it works both on windows and other OSes.

Are you happy for this to be closed and just use ./** ?

@romainquellec
Copy link
Author

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants