serverless-plugin-typescript icon indicating copy to clipboard operation
serverless-plugin-typescript copied to clipboard

Not including additional files on build/package

Open pdashford opened this issue 5 years ago • 5 comments

When building and deploying a lambda typescript function i want to include some static files and additional js files. When I have the following in serverless.yml

package: individually: true

Then in my function setup;

package: include: - src/lambdas/viewer/* - src/lambdas/viewer/** - src/lambdas/viewer/viewerjs/* - src/lambdas/viewer/viewerjs/**

When it builds all it copies is the compiled typescript file and not the additional files located in the viewerjs subfolder.

Thanks

pdashford avatar Sep 29 '19 09:09 pdashford

I have a similar query - I would like to include a docx file, did you ever get a solution?

andymccullough avatar Oct 11 '19 12:10 andymccullough

I am also stumbled upon this after upgrading to 1.1.9, on 1.1.7 everything is working fine.

vkartaviy avatar Oct 30 '19 16:10 vkartaviy

So weird, I am able to copy files by specifying the folder path as you do, for example, copying dist folder and its files into .build one by using:

package:
    include:
        - dist/**

Using latest version (1.1.9). Do you have any other plugin besides this one?

KingDarBoja avatar Dec 20 '19 17:12 KingDarBoja

Any solution or workaround to include different files in .build?

bayraak avatar Mar 27 '21 12:03 bayraak

As @KingDarBoja said, adding

package: include: - src/**

worked for me when trying to include .tsx files. The traditional tsconfig.json 'include' array wasn't working.

jamesworden avatar Jun 03 '21 20:06 jamesworden