serverless / serverless-plugin-typescript

Serverless plugin for zero-config Typescript support
MIT License
781 stars 222 forks source link

How to Trigger `.build` Directory Recompile / Watch with non *.ts Files #302

Open NicoHinderling opened 7 months ago

NicoHinderling commented 7 months ago

Hi there! I have been really enjoying this plugin! 😁

I have one question. For my project, I have some .html files that I use for email templates. When I change my .ts files, "Compiling with Typescript..." indeed gets kicked off, however changing those *.html files does not.

I found this confusing since the .build directory contains the *.html file copies that are actually served. When I did local testing, it took me 20 minutes to realize why my changes to the HTML templates were not being registered (the copies in .build were remaining the same).

Is it possible to change the config so that changes to other file types (like my *.html files) kicks off a recompilation of the .build dir?

What I've Tried (Unsuccessfully)

Please let me know if I'm doing something dumb or if this is currently not possible (in which case, perhaps this could be a feature request 😅)!

Thank you!

juan-mesh commented 6 months ago

I'm not an expert but did you tried to include those files in your serverless package:

package:
  include:
    - src/**
NicoHinderling commented 6 months ago

package: include:

  • src/**

yes. it's all good, honestly just ended up testing the html the old fashion way and then once good, wiped the .build folder.

It would be really nice to add this support, but I understand if this is out of scope and will leave it up to the maintainers if they want to pursue or close this 🙏