aws-cdk: Replace __dirname
#26054
Labels
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p3
Describe the feature
Replace the global variable
__dirname
used with an alternative that properly handles special characters and is more widely supportedUse Case
I've seen issues in #21161, and #18470, and may be running into issues myself due to path resolution shenanigans on my system with the
__dirname
global variable.Proposed Solution
It seems feasible from my limited knowledge of Node.js to use
path.dirname(url.fileURLToPath(import.meta.url))
instead, given its introduction back in Node.js 10.12.Other Information
No response
Acknowledgements
CDK version used
2.80.0
Environment details (OS name and version, etc.)
NixOS 23.05
The text was updated successfully, but these errors were encountered: