@datadog/webpack-plugin 0.0.13-9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5989,11 +5989,22 @@ const outputModulesTimings = (timings) => {
5989
5989
  output += getOutput(times, (module) => module.increment);
5990
5990
  return output;
5991
5991
  };
5992
+ const shouldShowOutput = (output) => {
5993
+ if (typeof output === "boolean") {
5994
+ return output;
5995
+ }
5996
+ if (typeof output === "string") {
5997
+ return true;
5998
+ }
5999
+ if (!output) {
6000
+ return true;
6001
+ }
6002
+ return output.logs !== false;
6003
+ };
5992
6004
  const outputTexts = (context, options) => {
5993
6005
  const { output } = options[CONFIG_KEY];
5994
6006
  const { report, bundler } = context;
5995
- const log = getLogFn(options.logLevel, PLUGIN_NAME);
5996
- if (output === false) {
6007
+ if (!shouldShowOutput(output)) {
5997
6008
  return;
5998
6009
  }
5999
6010
  let outputString = "";
@@ -6009,7 +6020,7 @@ const outputTexts = (context, options) => {
6009
6020
  if (bundler.esbuild) {
6010
6021
  outputString += outputEsbuild(bundler.esbuild);
6011
6022
  }
6012
- log(outputString);
6023
+ console.log(outputString);
6013
6024
  };
6014
6025
 
6015
6026
  const output = async (context, options) => {
@@ -6080,10 +6091,13 @@ const wrapPlugins = (build, context) => {
6080
6091
  };
6081
6092
  });
6082
6093
  for (const plugin of plugins) {
6083
- const newBuildObject = getNewBuildObject(build, plugin.name, context);
6094
+ if (plugin.name === PLUGIN_NAME) {
6095
+ continue;
6096
+ }
6084
6097
  const oldSetup = plugin.setup;
6085
- plugin.setup = () => {
6086
- oldSetup({
6098
+ plugin.setup = async (esbuild) => {
6099
+ const newBuildObject = getNewBuildObject(esbuild, plugin.name, context);
6100
+ await oldSetup({
6087
6101
  ...newBuildObject,
6088
6102
  // Use non-modified plugins for other plugins
6089
6103
  initialOptions: { ...newBuildObject.initialOptions, plugins: initialPlugins }