Closed
Description
Bug description
npm production
package of `powetools-logger' is breaking in 0.0.7, due to importing commons package in Logger.ts- Error due to the
tests
export that are part of the commons/index
Expected Behavior
0.0.7 version to work fine without module error
when tests
folder are removed at the time of pruning for production-ready build
(Or if the package tests
being exported out of commons is needed, please rename the folder as pruning utilities like node-prune are trimming off tests
)
Current Behavior
No Module Found Error when using Powertools Logger package
stack": [
"Runtime.ImportModuleError: Error: Cannot find module './tests/resources/contexts'",
"Require stack:",
"- /var/task/node_modules/@aws-lambda-powertools/commons/lib/index.js",
"- /var/task/node_modules/@aws-lambda-powertools/logger/lib/Logger.js",
"- /var/task/node_modules/@aws-lambda-powertools/logger/lib/index.js",
Possible Solution
- Do not export
tests
- Or if the package
tests
needs to be exported, please rename the folder as pruning utilities like node-prune are trimming offtests
)
Steps to Reproduce
npm install
project with"@aws-lambda-powertools/logger": "^0.7.0"
node-prune
using https://github.com/tj/node-prune