serverless-webpack have a trigger on before:offline:start, So I changed offline hook so we will have offline:start hook.
Also, change the generated function.jsonscriptFile property to point to .webpack folder
Everything should work the same as before, just when running offline command webpack plugin (if exists) will compile the files
How can we verify it:
cd examples/typescript-webpack
npm install
npm run offline
You should see the error:
This is the current behavior.
To fix it we need to link the new version of the library.
go to the root directory and run npm link
then go back to the example folder and run npm link serverless-azure-functions
npm run offline
AFTER releasing a new version with this fix we should update the version in the example folder so it will work without the need to run npm link
Todos:
Note: Run npm run test:ci to run all validation checks on proposed changes
[x] Ensure there are no lint errors. Validate via npm run lint Note: Some reported issues can be automatically fixed by running npm run lint:fix
[x] Write tests and confirm existing functionality is not broken. Validate via npm test
[ ] Write documentation
[x] Provide verification config / commands / resources
[x] Enable "Allow edits from maintainers" for this PR
[x] Update the messages below
Is this ready for review?: YES Is it a breaking change?: NO
What did you implement:
Use webpack output files (if exists) on offline command
Closes https://github.com/serverless/serverless-azure-functions/issues/392 https://github.com/serverless/serverless-azure-functions/issues/366
How did you implement it:
serverless-webpack
have a trigger onbefore:offline:start
, So I changed offline hook so we will haveoffline:start
hook. Also, change the generatedfunction.json
scriptFile
property to point to.webpack
folder Everything should work the same as before, just when running offline command webpack plugin (if exists) will compile the filesHow can we verify it:
You should see the error: This is the current behavior.
To fix it we need to link the new version of the library. go to the root directory and run
npm link
then go back to the example folder and runnpm link serverless-azure-functions
npm run offline
AFTER releasing a new version with this fix we should update the version in the example folder so it will work without the need to run npm link
Todos:
Note: Run
npm run test:ci
to run all validation checks on proposed changesValidate via
npm run lint
Note: Some reported issues can be automatically fixed by running
npm run lint:fix
Validate via
npm test
Is this ready for review?: YES
Is it a breaking change?: NO