toolsplus / nx-forge

Atlassian Forge plugin for Nx
https://toolsplus.github.io/nx-forge/
MIT License
17 stars 4 forks source link

webpack externals require manual entry in package.json of build output #64

Open dpsthree opened 8 months ago

dpsthree commented 8 months ago

My Forge backend code utilizes the AWS Lamda library, @aws-sdk/client-lambda. This has the unfortunate behavior of taking an implicit requirement on the aws-sdk root-level package. Long story short, to get this to work with the current webpack process required that I list aws-sdk as a webpack external


module.exports = composePlugins(withNx(), (config) => {
  config.externals = {
    'aws-sdk': 'aws-sdk',
  };
  return config;
});

This compiles correctly, but the package.json file copied to the dist directory does not include aws-sdk because of the implicit dependency. It would be nice if the nx-forge build process processes any externals and copies their package.json entries to the build directory.