@rsdoctor/rspack-plugin 0.2.3-beta.0 → 0.2.4
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/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/multiple.d.ts +1 -0
- package/dist/multiple.d.ts.map +1 -0
- package/dist/plugin.d.ts +3 -2
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +5 -6
- package/dist/probeLoader.d.ts +1 -0
- package/dist/probeLoader.d.ts.map +1 -0
- package/dist/{builtinLoaderPlugin.d.ts → probeLoaderPlugin.d.ts} +2 -1
- package/dist/probeLoaderPlugin.d.ts.map +1 -0
- package/dist/{builtinLoaderPlugin.js → probeLoaderPlugin.js} +16 -9
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +6 -6
package/dist/constants.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare const pluginTapPreOptions: Tap;
|
|
|
5
5
|
export declare const internalPluginTapPreOptions: (namespace: string) => Tap;
|
|
6
6
|
export declare const internalPluginTapPostOptions: (namespace: string) => Tap;
|
|
7
7
|
export declare const pkg: any;
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,aAAa,yBAAyB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,EAAE,GAGlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,GAGjC,CAAC;AAEF,eAAO,MAAM,2BAA2B,cAAe,MAAM,KAAG,GAG9D,CAAC;AAEH,eAAO,MAAM,4BAA4B,cAAe,MAAM,KAAG,GAG/D,CAAC;AAEH,eAAO,MAAM,GAAG,KAA6B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
package/dist/multiple.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiple.d.ts","sourceRoot":"","sources":["../src/multiple.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIhD,qBAAa,4BAA4B,CACvC,KAAK,SAAS,MAAM,CAAC,cAAc,EAAE,CACrC,SAAQ,oBAAoB,CAAC,KAAK,CAAC;IAEnC,OAAO,CAAC,UAAU,CAAwB;gBAE9B,OAAO,GAAE,6BAA6B,CAAC,KAAK,CAAM;CAuB/D"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Compiler } from '@rspack/core';
|
|
1
|
+
import type { Compiler, Stats } from '@rspack/core';
|
|
2
2
|
import { ModuleGraph } from '@rsdoctor/graph';
|
|
3
3
|
import { RsdoctorSlaveSDK, RsdoctorWebpackSDK } from '@rsdoctor/sdk';
|
|
4
4
|
import type { RsdoctorPluginInstance, RsdoctorPluginOptionsNormalized, RsdoctorRspackPluginOptions } from '@rsdoctor/core';
|
|
@@ -20,6 +20,7 @@ export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]>
|
|
|
20
20
|
* @memberof RsdoctorWebpackPlugin
|
|
21
21
|
*/
|
|
22
22
|
ensureModulesChunksGraphApplied(compiler: Compiler): void;
|
|
23
|
-
done: (compiler: Compiler) => Promise<void>;
|
|
23
|
+
done: (compiler: Compiler, stats: Stats) => Promise<void>;
|
|
24
24
|
getRspackConfig(compiler: Compiler, version: string): void;
|
|
25
25
|
}
|
|
26
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA8B,KAAK,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAarE,OAAO,KAAK,EACV,sBAAsB,EACtB,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,MAAM,EAIP,MAAM,iBAAiB,CAAC;AAOzB,qBAAa,oBAAoB,CAAC,KAAK,SAAS,MAAM,CAAC,cAAc,EAAE,CACrE,YAAW,sBAAsB,CAAC,QAAQ,EAAE,KAAK,CAAC;IAElD,SAAgB,IAAI,0BAAiB;IAErC,SAAgB,GAAG,EAAE,kBAAkB,GAAG,gBAAgB,CAAC;IAEpD,cAAc,EAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC,SAAS,CAAC,eAAe,UAAS;IAE3B,YAAY,EAAE,WAAW,CAAC;IAE1B,OAAO,EAAE,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAEhD,eAAe,EAAE,OAAO,CAAC;gBAEpB,OAAO,CAAC,EAAE,2BAA2B,CAAC,KAAK,CAAC;IAgBxD,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IA8CjC;;;;;OAKG;IACI,+BAA+B,CAAC,QAAQ,EAAE,QAAQ;IAIlD,IAAI,aAAoB,QAAQ,SAAS,KAAK,KAAG,QAAQ,IAAI,CAAC,CAwCnE;IAEK,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM;CAwB3D"}
|
package/dist/plugin.js
CHANGED
|
@@ -38,14 +38,14 @@ var import_types = require("@rsdoctor/types");
|
|
|
38
38
|
var import_path = __toESM(require("path"));
|
|
39
39
|
var import_constants = require("./constants");
|
|
40
40
|
var import_lodash = require("lodash");
|
|
41
|
-
var
|
|
41
|
+
var import_probeLoaderPlugin = require("./probeLoaderPlugin");
|
|
42
42
|
var import_common = require("@rsdoctor/utils/common");
|
|
43
43
|
class RsdoctorRspackPlugin {
|
|
44
44
|
constructor(options) {
|
|
45
45
|
this.name = import_constants.pluginTapName;
|
|
46
46
|
this.browserIsOpened = false;
|
|
47
|
-
this.done = async (compiler) => {
|
|
48
|
-
const json =
|
|
47
|
+
this.done = async (compiler, stats) => {
|
|
48
|
+
const json = stats.toJson({
|
|
49
49
|
all: false,
|
|
50
50
|
version: true,
|
|
51
51
|
chunks: true,
|
|
@@ -107,6 +107,7 @@ class RsdoctorRspackPlugin {
|
|
|
107
107
|
);
|
|
108
108
|
new import_plugins.InternalSummaryPlugin(this).apply(compiler);
|
|
109
109
|
if (this.options.features.loader && !import_common.Loader.isVue(compiler)) {
|
|
110
|
+
new import_probeLoaderPlugin.ProbeLoaderPlugin().apply(compiler);
|
|
110
111
|
new import_plugins.InternalLoaderPlugin(this).apply(compiler);
|
|
111
112
|
}
|
|
112
113
|
if (this.options.features.plugins) {
|
|
@@ -116,9 +117,7 @@ class RsdoctorRspackPlugin {
|
|
|
116
117
|
new import_plugins.InternalBundlePlugin(this).apply(compiler);
|
|
117
118
|
}
|
|
118
119
|
new import_plugins.InternalRulesPlugin(this).apply(compiler);
|
|
119
|
-
|
|
120
|
-
new import_builtinLoaderPlugin.BuiltinLoaderPlugin().apply(compiler);
|
|
121
|
-
}
|
|
120
|
+
new import_plugins.InternalErrorReporterPlugin(this).apply(compiler);
|
|
122
121
|
}
|
|
123
122
|
/**
|
|
124
123
|
* @description Generate ModuleGraph and ChunkGraph from stats and webpack module apis;
|
package/dist/probeLoader.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import { Plugin } from '@rsdoctor/types';
|
|
|
2
2
|
import type { LoaderDefinitionFunction } from '@rspack/core';
|
|
3
3
|
declare const loaderModule: Plugin.LoaderDefinition<Parameters<LoaderDefinitionFunction>, {}>;
|
|
4
4
|
export default loaderModule;
|
|
5
|
+
//# sourceMappingURL=probeLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probeLoader.d.ts","sourceRoot":"","sources":["../src/probeLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAO,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAK7D,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,gBAAgB,CACzC,UAAU,CAAC,wBAAwB,CAAC,EACpC,EAAE,CAwCH,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probeLoaderPlugin.d.ts","sourceRoot":"","sources":["../src/probeLoaderPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAS7C,qBAAa,iBAAiB;IAC5B,KAAK,CAAC,QAAQ,EAAE,QAAQ;IAoBxB,OAAO,CAAC,cAAc;CA0CvB"}
|
|
@@ -26,19 +26,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var probeLoaderPlugin_exports = {};
|
|
30
|
+
__export(probeLoaderPlugin_exports, {
|
|
31
|
+
ProbeLoaderPlugin: () => ProbeLoaderPlugin
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(probeLoaderPlugin_exports);
|
|
34
34
|
var import_build_utils = require("@rsdoctor/core/build-utils");
|
|
35
35
|
var import_path = __toESM(require("path"));
|
|
36
36
|
const BuiltinLoaderName = "builtin:swc-loader";
|
|
37
|
-
|
|
37
|
+
const ESMLoaderFile = ".mjs";
|
|
38
|
+
class ProbeLoaderPlugin {
|
|
38
39
|
apply(compiler) {
|
|
39
40
|
compiler.hooks.beforeRun.tap(
|
|
40
41
|
{
|
|
41
|
-
name: "
|
|
42
|
+
name: "ProbeLoaderPlugin"
|
|
42
43
|
},
|
|
43
44
|
() => {
|
|
44
45
|
this.addProbeLoader(compiler);
|
|
@@ -46,7 +47,7 @@ class BuiltinLoaderPlugin {
|
|
|
46
47
|
);
|
|
47
48
|
compiler.hooks.watchRun.tap(
|
|
48
49
|
{
|
|
49
|
-
name: "
|
|
50
|
+
name: "ProbeLoaderPlugin"
|
|
50
51
|
},
|
|
51
52
|
() => {
|
|
52
53
|
this.addProbeLoader(compiler);
|
|
@@ -78,14 +79,20 @@ class BuiltinLoaderPlugin {
|
|
|
78
79
|
}
|
|
79
80
|
return rule;
|
|
80
81
|
};
|
|
81
|
-
compiler.options.module.rules = import_build_utils.Utils.
|
|
82
|
+
compiler.options.module.rules = import_build_utils.Utils.addProbeLoader2Rules(
|
|
82
83
|
rules,
|
|
83
84
|
BuiltinLoaderName,
|
|
84
85
|
appendRule
|
|
85
86
|
);
|
|
87
|
+
compiler.options.module.rules = import_build_utils.Utils.addProbeLoader2Rules(
|
|
88
|
+
rules,
|
|
89
|
+
ESMLoaderFile,
|
|
90
|
+
appendRule,
|
|
91
|
+
false
|
|
92
|
+
);
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
95
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
96
|
0 && (module.exports = {
|
|
90
|
-
|
|
97
|
+
ProbeLoaderPlugin
|
|
91
98
|
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,4BAA4B,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;IACxD;;;OAGG;IACH,wBAAwB,CAAC,EAAE,4BAA4B,CACrD;KAAE,CACH,CAAC,0BAA0B,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,4BACf,SAAQ,oBAAoB;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/rspack-plugin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"loader-utils": "^2.0.4",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@rsdoctor/core": "0.2.
|
|
19
|
-
"@rsdoctor/graph": "0.2.
|
|
20
|
-
"@rsdoctor/utils": "0.2.
|
|
21
|
-
"@rsdoctor/sdk": "0.2.
|
|
18
|
+
"@rsdoctor/core": "0.2.4",
|
|
19
|
+
"@rsdoctor/graph": "0.2.4",
|
|
20
|
+
"@rsdoctor/utils": "0.2.4",
|
|
21
|
+
"@rsdoctor/sdk": "0.2.4"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@rspack/core": "0.5.1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/tapable": "2.2.2",
|
|
29
29
|
"tslib": "2.4.1",
|
|
30
30
|
"typescript": "^5.2.2",
|
|
31
|
-
"@rsdoctor/types": "0.2.
|
|
31
|
+
"@rsdoctor/types": "0.2.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@rspack/core": "^0.5.1"
|