Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files that contain dots are ignored during packaging #143

Open
crash7 opened this issue Aug 25, 2020 · 0 comments
Open

Files that contain dots are ignored during packaging #143

crash7 opened this issue Aug 25, 2020 · 0 comments

Comments

@crash7
Copy link

crash7 commented Aug 25, 2020

DISCLAIMER: This issue was raised against serverless/serverless too, but since I use jetpack for some services and it contains the same issue, maybe it's a good idea to add a fix to the plugin too.

I have a serverless service that contains files that starts with something like [...file].js. When running sls package, those files don't end in the zipfile because they are being ignored.

The problem, at least one part of it, lies in the dot parameter that the library use for globby:
https://github.com/FormidableLabs/serverless-jetpack/blob/master/util/bundle.js#L18

I have multiple ideas for a fix (maybe use globby again without dot: true to get just valid files?) but I would like to know your thoughts before I try to make a PR.

So, given a file structure like this:

folder/
  other.js
  [...file].js
handler.js

The end result is:

Archive:  .serverless/my-service.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  01-01-1980 00:00   folder/other.js
      442  01-01-1980 00:00   handler.js
---------                     -------
      442                     2 files

This is my serverless.yml:

service: my-service

provider:
  name: aws
  runtime: nodejs12.x

package:
  excludeDevDependencies: true
  exclude: 
    - '**/*'
  include:
    - handler.js
    - folder/**
    - folder/[...file].js

functions:
  hello:
    handler: handler.hello

plugins:
  - serverless-jetpack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant