Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

373
Views
Exclude everything in the build except one folder Serverless Patterns

I am working on a serverless project. what I want to achieve or want to know if it is possible or not is that when I run sls package i want the serverless to exclude every file/folder in the root directory except for one folder.

I have tried multiple ways to do it using patterns in serverless file but nothing worked.

package: #This didn't not work
  patterns:
    - '!./**'
    - './dist/**'


package: # This didn't work
  patterns:
    - '!.*/**'
    - './dist/**'

Am I missing something? Because I was able to exclude particular folders if I define them explicitly. But I was unable to exclude the entire root directory using wild card characters.

package: # This works and excludes constant folder
  patterns:
    - '!./constants/**'

I know I can achieve it by making a script. But I want to know if it can be done via the serverless framework by simply defining the patterns.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!