@datadog/webpack-plugin 2.3.0-dev → 2.3.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.
@@ -1,5 +1,5 @@
1
1
  import * as webpack from 'webpack';
2
- import * as src from 'src';
2
+ import { UnpluginOptions } from 'unplugin';
3
3
 
4
4
  declare const CONFIG_KEY$1: "rum";
5
5
 
@@ -34,6 +34,65 @@ type types = {
34
34
  TelemetryOptions: TelemetryOptions;
35
35
  };
36
36
 
37
+ declare class TrackedFilesMatcher {
38
+ private trackedFilenames;
39
+ constructor(trackedFiles: string[]);
40
+ private displaySource;
41
+ matchSourcemap(srcmapPath: string, onSourcesNotFound: (reason: string) => void): string[] | undefined;
42
+ matchSources(sources: string[]): string[];
43
+ rawTrackedFilesList(): string[];
44
+ private getFilename;
45
+ }
46
+
47
+ interface RepositoryData {
48
+ hash: string;
49
+ remote: string;
50
+ trackedFilesMatcher: TrackedFilesMatcher;
51
+ }
52
+ type File = {
53
+ filepath: string;
54
+ name: string;
55
+ size: number;
56
+ type: string;
57
+ };
58
+ type Input = File & {
59
+ dependencies: Set<Input>;
60
+ dependents: Set<Input>;
61
+ };
62
+ type Output = File & {
63
+ inputs: (Input | Output)[];
64
+ };
65
+ type Entry = Output & {
66
+ outputs: Output[];
67
+ };
68
+ type BuildReport = {
69
+ errors: string[];
70
+ warnings: string[];
71
+ entries?: Entry[];
72
+ inputs?: Input[];
73
+ outputs?: Output[];
74
+ start?: number;
75
+ end?: number;
76
+ duration?: number;
77
+ writeDuration?: number;
78
+ };
79
+ type BundlerReport = {
80
+ name: string;
81
+ fullName: string;
82
+ outDir: string;
83
+ rawConfig?: any;
84
+ variant?: string;
85
+ };
86
+ type GlobalContext = {
87
+ auth?: AuthOptions;
88
+ bundler: BundlerReport;
89
+ build: BuildReport;
90
+ cwd: string;
91
+ git?: RepositoryData;
92
+ start: number;
93
+ version: string;
94
+ };
95
+ type GetCustomPlugins<T> = (options: T, context: GlobalContext) => UnpluginOptions[];
37
96
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
38
97
  type AuthOptions = {
39
98
  apiKey?: string;
@@ -46,6 +105,7 @@ interface GetPluginsOptions {
46
105
  interface Options extends GetPluginsOptions {
47
106
  [CONFIG_KEY$1]?: RumOptions;
48
107
  [CONFIG_KEY]?: TelemetryOptions;
108
+ customPlugins?: GetCustomPlugins<Options>;
49
109
  }
50
110
 
51
111
  interface Metric {
@@ -72,7 +132,7 @@ type TelemetryOptions = {
72
132
  timestamp?: number;
73
133
  };
74
134
 
75
- declare const datadogWebpackPlugin: (options: src.WebpackPluginOptions) => webpack.WebpackPluginInstance;
135
+ declare const datadogWebpackPlugin: (options: Options) => webpack.WebpackPluginInstance;
76
136
 
77
137
  declare const version: string;
78
138
  declare const helpers: {