Closed odedniv closed 6 years ago
What's your use case here?
Doesn't this break Windows users by making the path delimiter always set as /?
I believe that's the way require works in node, and it should work on Windows.
We use webpack before deploying or functions to include dependencies. Are you familiar with webpack?
This kind of thing is my concern: https://stackoverflow.com/questions/34329149/nodejs-absolute-paths-in-windows-with-forward-slash
Forward slash is only a problem if you user absolute paths, for relative paths it should work cross platform as far as I can tell.
But how would cfn lambda be used on Windows? Lambda is Linux only
Actually .\ doesn't (or didn't) seem to work on Windows, ./ however does: https://github.com/nodejs/node/issues/6049
Tired this week, lots of work - thanks for contributing. Cutting release with this in it. (2.1.3)
It's common to webpack functions to use dependencies and keep minimal sized zips. This PR allows it (though webpack still shows warnings).
require('./...)
instead ofrequire.resolve(__dirname, ...)
fs
withrequire
where possiblerequire.main === module
instead of!require.parent