@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.
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +20 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +20 -6
- package/dist/src/index.mjs.map +1 -1
- package/package.json +6 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as webpack from 'webpack';
|
|
2
|
-
import * as src from 'src';
|
|
3
2
|
|
|
4
3
|
type LogLevel = 'debug' | 'warn' | 'error' | 'none';
|
|
5
4
|
interface GetPluginsOptions {
|
|
@@ -28,6 +27,7 @@ type OutputOptions = boolean | string | {
|
|
|
28
27
|
dependencies?: boolean;
|
|
29
28
|
bundler?: boolean;
|
|
30
29
|
metrics?: boolean;
|
|
30
|
+
logs?: boolean;
|
|
31
31
|
};
|
|
32
32
|
type TelemetryOptions = {
|
|
33
33
|
disabled?: boolean;
|
|
@@ -59,7 +59,7 @@ declare const helpers: {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
declare const datadogWebpackPlugin: (options:
|
|
62
|
+
declare const datadogWebpackPlugin: (options: Options) => webpack.WebpackPluginInstance;
|
|
63
63
|
|
|
64
64
|
export { type types as TelemetryTypes, type Options as WebpackPluginOptions, datadogWebpackPlugin, helpers };
|
|
65
65
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.js
CHANGED
|
@@ -6011,11 +6011,22 @@ const outputModulesTimings = (timings) => {
|
|
|
6011
6011
|
output += getOutput(times, (module) => module.increment);
|
|
6012
6012
|
return output;
|
|
6013
6013
|
};
|
|
6014
|
+
const shouldShowOutput = (output) => {
|
|
6015
|
+
if (typeof output === "boolean") {
|
|
6016
|
+
return output;
|
|
6017
|
+
}
|
|
6018
|
+
if (typeof output === "string") {
|
|
6019
|
+
return true;
|
|
6020
|
+
}
|
|
6021
|
+
if (!output) {
|
|
6022
|
+
return true;
|
|
6023
|
+
}
|
|
6024
|
+
return output.logs !== false;
|
|
6025
|
+
};
|
|
6014
6026
|
const outputTexts = (context, options) => {
|
|
6015
6027
|
const { output } = options[CONFIG_KEY];
|
|
6016
6028
|
const { report, bundler } = context;
|
|
6017
|
-
|
|
6018
|
-
if (output === false) {
|
|
6029
|
+
if (!shouldShowOutput(output)) {
|
|
6019
6030
|
return;
|
|
6020
6031
|
}
|
|
6021
6032
|
let outputString = "";
|
|
@@ -6031,7 +6042,7 @@ const outputTexts = (context, options) => {
|
|
|
6031
6042
|
if (bundler.esbuild) {
|
|
6032
6043
|
outputString += outputEsbuild(bundler.esbuild);
|
|
6033
6044
|
}
|
|
6034
|
-
log(outputString);
|
|
6045
|
+
console.log(outputString);
|
|
6035
6046
|
};
|
|
6036
6047
|
|
|
6037
6048
|
const output = async (context, options) => {
|
|
@@ -6102,10 +6113,13 @@ const wrapPlugins = (build, context) => {
|
|
|
6102
6113
|
};
|
|
6103
6114
|
});
|
|
6104
6115
|
for (const plugin of plugins) {
|
|
6105
|
-
|
|
6116
|
+
if (plugin.name === PLUGIN_NAME) {
|
|
6117
|
+
continue;
|
|
6118
|
+
}
|
|
6106
6119
|
const oldSetup = plugin.setup;
|
|
6107
|
-
plugin.setup = () => {
|
|
6108
|
-
|
|
6120
|
+
plugin.setup = async (esbuild) => {
|
|
6121
|
+
const newBuildObject = getNewBuildObject(esbuild, plugin.name, context);
|
|
6122
|
+
await oldSetup({
|
|
6109
6123
|
...newBuildObject,
|
|
6110
6124
|
// Use non-modified plugins for other plugins
|
|
6111
6125
|
initialOptions: { ...newBuildObject.initialOptions, plugins: initialPlugins }
|