toolsplus/nx-forge

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

Opened this issue · 0 comments

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.