In the context of a project I am working on, a capability I am looking to achieve is being able to support running code in serverless environments, and so in those cases it is pretty common to bundle all the needed code into a "fat" lambda, so a single bundle.js artifact can be generated and uploaded to any cloud function service.
As this generally implies bundling of some sort to generate the single output file, the inclusion of a .json file complicates this a bit. I am using Rollup and so it requires a plugin / custom transform to convert the file into something Rollup can understand, like an ESM module.
I can see from the code the value of bundling this to get a reference to the version from package.json. Would the project be open to alternate ways to handle this? Maybe something like below?
Hello! ๐
Was hoping to get your thoughts on an observation I had with a particular line in the project. Specifically where package.json is getting referenced via a
require
call.In the context of a project I am working on, a capability I am looking to achieve is being able to support running code in serverless environments, and so in those cases it is pretty common to bundle all the needed code into a "fat" lambda, so a single bundle.js artifact can be generated and uploaded to any cloud function service.
As this generally implies bundling of some sort to generate the single output file, the inclusion of a .json file complicates this a bit. I am using Rollup and so it requires a plugin / custom transform to convert the file into something Rollup can understand, like an ESM module.
I can see from the code the value of bundling this to get a reference to the
version
from package.json. Would the project be open to alternate ways to handle this? Maybe something like below?Thanks in advance for any consideration on this, and thank you so much for all the great work on this project! ๐