@rsdoctor/webpack-plugin 0.1.0 → 0.1.2
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/README.md +30 -3
- package/dist/constants.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/multiple.d.ts +3 -3
- package/dist/plugin.d.ts +21 -21
- package/dist/plugins/resolver.d.ts +26 -25
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,11 +1,38 @@
|
|
|
1
|
-
# Rsdoctor
|
|
1
|
+
# Rsdoctor plugin
|
|
2
2
|
|
|
3
|
-
Rsdoctor is
|
|
3
|
+
This Rsdoctor plugin is an analysis plugin for the Webpack builder.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## features
|
|
6
|
+
|
|
7
|
+
- Rsdoctor is a one-stop tool for diagnosing and analyzing the build process and build artifacts.
|
|
8
|
+
- Rsdoctor is a tool that supports Webpack and Rspack build analysis.
|
|
9
|
+
- Rsdoctor is an analysis tool that can display the time-consuming and behavioral details of the compilation.
|
|
10
|
+
- Rsdoctor is a tool that provides bundle Diff and other anti-degradation capabilities simultaneously.
|
|
11
|
+
|
|
12
|
+
## Note
|
|
13
|
+
|
|
14
|
+
This plugin is used by the `Webpack` repo to open Rsdoctor, [Quik Start](https://rsdoctor.dev/guide/start/quick-start).
|
|
15
|
+
|
|
16
|
+
Initialize the RsdoctorWebpackPlugin plugin in the [plugins](https://webpack.js.org/configuration/plugins/#plugins) section of the `webpack.config.js` file, as shown below:
|
|
17
|
+
|
|
18
|
+
```js title="webpack.config.js"
|
|
19
|
+
const { RsdoctorWebpackPlugin } = require('@rsdoctor/webpack-plugin');
|
|
20
|
+
|
|
21
|
+
module.exports = {
|
|
22
|
+
// ...
|
|
23
|
+
plugins: [
|
|
24
|
+
process.env.RSDOCTOR &&
|
|
25
|
+
new RsdoctorWebpackPlugin({
|
|
26
|
+
// options
|
|
27
|
+
}),
|
|
28
|
+
].filter(Boolean),
|
|
29
|
+
};
|
|
30
|
+
```
|
|
6
31
|
|
|
7
32
|
## Documentation
|
|
8
33
|
|
|
34
|
+
https://rsdoctor.dev/
|
|
35
|
+
|
|
9
36
|
## Contributing
|
|
10
37
|
|
|
11
38
|
Please read the [Contributing Guide](https://github.com/web-infra-dev/rsdoctor/blob/main/CONTRIBUTING.md).
|
package/dist/constants.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare const pluginTapName = "RsdoctorWebpackPlugin";
|
|
|
3
3
|
export declare const pluginTapPostOptions: Tap;
|
|
4
4
|
export declare const pluginTapPreOptions: Tap;
|
|
5
5
|
export declare const internalPluginTapPreOptions: (namespace: string) => Tap;
|
|
6
|
-
export declare const internalPluginTapPostOptions: (namespace: string) => Tap;
|
|
6
|
+
export declare const internalPluginTapPostOptions: (namespace: string) => Tap;
|
package/dist/index.d.ts
CHANGED
package/dist/multiple.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import type { Linter } from '@rsdoctor/types';
|
|
|
2
2
|
import type { RsdoctorWebpackMultiplePluginOptions } from '@rsdoctor/core';
|
|
3
3
|
import { RsdoctorWebpackPlugin } from './plugin';
|
|
4
4
|
export declare class RsdoctorWebpackMultiplePlugin<Rules extends Linter.ExtendRuleData[]> extends RsdoctorWebpackPlugin<Rules> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
private controller;
|
|
6
|
+
constructor(options?: RsdoctorWebpackMultiplePluginOptions<Rules>);
|
|
7
|
+
}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -4,24 +4,24 @@ import { RsdoctorWebpackSDK } from '@rsdoctor/sdk';
|
|
|
4
4
|
import { Linter } from '@rsdoctor/types';
|
|
5
5
|
import type { Compiler } from 'webpack';
|
|
6
6
|
export declare class RsdoctorWebpackPlugin<Rules extends Linter.ExtendRuleData[]> implements RsdoctorPluginInstance<Compiler, Rules> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
7
|
+
readonly name = "RsdoctorWebpackPlugin";
|
|
8
|
+
readonly options: RsdoctorPluginOptionsNormalized<Rules>;
|
|
9
|
+
readonly sdk: RsdoctorWebpackSDK;
|
|
10
|
+
modulesGraph: ModuleGraph;
|
|
11
|
+
private outsideInstance;
|
|
12
|
+
_bootstrapTask: Promise<unknown>;
|
|
13
|
+
protected browserIsOpened: boolean;
|
|
14
|
+
chunkGraph: ChunkGraph;
|
|
15
|
+
constructor(options?: RsdoctorWebpackPluginOptions<Rules>);
|
|
16
|
+
apply(compiler: unknown): unknown;
|
|
17
|
+
afterPlugins: (compiler: Compiler) => void;
|
|
18
|
+
beforeRun: (compiler: Compiler) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* @description Generate ModuleGraph and ChunkGraph from stats and webpack module apis;
|
|
21
|
+
* @param {Compiler} compiler
|
|
22
|
+
* @return {*}
|
|
23
|
+
* @memberof RsdoctorWebpackPlugin
|
|
24
|
+
*/
|
|
25
|
+
ensureModulesChunksGraphApplied(compiler: Compiler): void;
|
|
26
|
+
done: () => Promise<void>;
|
|
27
|
+
}
|
|
@@ -2,36 +2,37 @@ import { InternalBasePlugin } from '@rsdoctor/core/plugins';
|
|
|
2
2
|
import { RsdoctorWebpackSDK } from '@rsdoctor/sdk';
|
|
3
3
|
import { SDK } from '@rsdoctor/types';
|
|
4
4
|
import type { Compiler, ResolvePluginInstance, Resolver } from 'webpack';
|
|
5
|
-
interface RsdoctorResolverPluginOptions {
|
|
5
|
+
interface RsdoctorResolverPluginOptions {
|
|
6
|
+
}
|
|
6
7
|
interface ResolveRequestContext {
|
|
7
|
-
|
|
8
|
+
issuer: string;
|
|
8
9
|
}
|
|
9
10
|
interface ResolveRequestWithContext {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
context: ResolveRequestContext;
|
|
12
13
|
}
|
|
13
14
|
export declare class RsdoctorResolverPlugin implements ResolvePluginInstance {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
protected options: RsdoctorResolverPluginOptions;
|
|
16
|
+
protected sdk: RsdoctorWebpackSDK;
|
|
17
|
+
protected tapOptions: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
protected contextMap: Map<string, [number, [number, number]]>;
|
|
21
|
+
constructor(options: RsdoctorResolverPluginOptions, sdk: RsdoctorWebpackSDK);
|
|
22
|
+
protected getResolverData(context: ResolveRequestContext, params: {
|
|
23
|
+
request: string;
|
|
24
|
+
query?: string;
|
|
25
|
+
result?: string;
|
|
26
|
+
error?: Error;
|
|
27
|
+
stacks?: SDK.ResolveStackData[];
|
|
28
|
+
}): SDK.PathResolverData | undefined;
|
|
29
|
+
protected getResolveStackData(request: ResolveRequestWithContext, path: string, name?: string): SDK.ResolveStackData;
|
|
30
|
+
protected getResolveRequest(request: string | undefined, ctx?: Parameters<Resolver['resolve']>[3]): string;
|
|
31
|
+
apply(resolver: Resolver): void;
|
|
31
32
|
}
|
|
32
33
|
export declare class InternalResolverPlugin extends InternalBasePlugin<Compiler> {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
readonly name = "resolver";
|
|
35
|
+
apply(compiler: Compiler): void;
|
|
36
|
+
afterPlugins: (compiler: Compiler) => void;
|
|
36
37
|
}
|
|
37
|
-
export {};
|
|
38
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/webpack-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"fs-extra": "^11.1.1",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
18
|
"webpack": "^5.89.0",
|
|
19
|
-
"@rsdoctor/core": "0.1.
|
|
20
|
-
"@rsdoctor/
|
|
21
|
-
"@rsdoctor/graph": "0.1.
|
|
22
|
-
"@rsdoctor/
|
|
19
|
+
"@rsdoctor/core": "0.1.2",
|
|
20
|
+
"@rsdoctor/sdk": "0.1.2",
|
|
21
|
+
"@rsdoctor/graph": "0.1.2",
|
|
22
|
+
"@rsdoctor/utils": "0.1.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/fs-extra": "^11.0.2",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/webpack": "5.28.0",
|
|
30
30
|
"tslib": "2.4.1",
|
|
31
31
|
"typescript": "^5.2.2",
|
|
32
|
-
"@rsdoctor/types": "0.1.
|
|
32
|
+
"@rsdoctor/types": "0.1.2"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public",
|