Replies: 2 comments
-
Are we able to do this in a way that's generic to any js file? If so, then this sounds great. |
Beta Was this translation helpful? Give feedback.
-
Out of curiosity, does something like this work? "use strict";
const pnp = require("${pnp}").setup();
module.exports = require("./${main}"); That would effectively set the current module's exports equal to all the exports of the main script - assuming that the main script itself set I may be missing something here though. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Unable to load the
handler
function fromentrypoint.js
in AWS Lambda.Describe the solution you'd like
When loading the
bundle.zip
into AWS Lambda and referencing itshandler
function viabundle/entrypoint.js
, it would be ideal if theentrypoint.js
was re-exporting module functions.Describe alternatives you've considered
Leveraging typescript, we can convert a simple export within the existing project, and thus copy its transpiled
__exportStar
polyfill to a customapp.js
(nearly equivalent toentrypoint.js
).https://github.com/ojkelly/yarn.build/blob/trunk/packages/plugins/plugin-build/src/commands/bundle/index.ts#L274-L284
app.js
Additional context
This would depend on the project's
tsconfig.json
target polyfills, and would likely be best to perform this step in theyarn bundle
command itself, with a call totsc
and anentrypoint.ts
file.Beta Was this translation helpful? Give feedback.
All reactions