Webpack needs module imports to be known at build time. The normal agent loader scans plugin files and loads target modules at run time, so the agent uses a separate static loader when it detects a bundle.
Webpack support is experimental.
The current static loader includes:
Axios and MySQL2 are not in the static loader because their package metadata cannot be loaded in the form expected by the current code. They can be instrumented by the normal loader but not by the current Webpack loader.
The static loader contains imports for all modules in the list above. Webpack may report a missing module even when your application does not use that plugin. Mark each unused optional module as false in resolve.alias.
module.exports = { target: 'node', resolve: { alias: { amqplib: false, 'aws-sdk': false, express: false, ioredis: false, mongodb: false, mongoose: false, mysql: false, pg: false, }, }, };
Keep a module out of this list when your bundle uses it and you want its plugin installed.
The bundled loader currently checks its internal plugin file name, including Plugin. For example:
export SW_AGENT_DISABLE_PLUGINS='MySQLPlugin,ExpressPlugin'
This differs from the normal loader, which uses mysql,express. Keep the value with the deployment that needs it.
package.json to check its version. A package that blocks this import cannot use the current static loader.If bundling is not required, run the normal Node.js output and use the normal plugin loader.