@rsdoctor/webpack-plugin 1.3.15 → 1.4.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/constants.d.ts +1 -0
- package/dist/index.cjs +114 -106
- package/dist/index.js +16 -3
- package/package.json +6 -6
package/dist/constants.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare const pluginTapPostOptions: Tap;
|
|
|
4
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
|
+
export declare const pkg: any;
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const __rslib_import_meta_url__ = "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
3
|
+
var __webpack_modules__ = {
|
|
4
|
+
"./package.json" (module) {
|
|
5
|
+
module.exports = JSON.parse('{"name":"@rsdoctor/webpack-plugin","version":"1.4.0","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/webpack-plugin"},"license":"MIT","main":"dist/index.cjs","types":"dist/index.d.ts","files":["dist"],"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"scripts":{"dev":"npm run start","build":"rslib build","start":"rslib build -w","test":"rstest run"},"dependencies":{"@rsdoctor/core":"workspace:*","@rsdoctor/graph":"workspace:*","@rsdoctor/sdk":"workspace:*","@rsdoctor/types":"workspace:*","@rsdoctor/utils":"workspace:*"},"devDependencies":{"@types/node":"^22.8.1","@types/tapable":"2.2.7","tslib":"2.8.1","typescript":"^5.9.2","webpack":"^5.97.1"},"peerDependencies":{"webpack":"5.x"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
|
|
6
|
+
}
|
|
7
|
+
}, __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
15
|
+
}
|
|
5
16
|
__webpack_require__.n = (module)=>{
|
|
6
17
|
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
|
|
7
18
|
return __webpack_require__.d(getter, {
|
|
@@ -13,119 +24,116 @@ __webpack_require__.n = (module)=>{
|
|
|
13
24
|
get: definition[key]
|
|
14
25
|
});
|
|
15
26
|
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
|
|
16
|
-
|
|
27
|
+
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
28
|
value: 'Module'
|
|
18
29
|
}), Object.defineProperty(exports1, '__esModule', {
|
|
19
30
|
value: !0
|
|
20
31
|
});
|
|
21
32
|
};
|
|
22
33
|
var __webpack_exports__ = {};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
34
|
+
for(var __rspack_i in (()=>{
|
|
35
|
+
let globalController;
|
|
36
|
+
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
|
|
37
|
+
RsdoctorWebpackMultiplePlugin: ()=>RsdoctorWebpackMultiplePlugin,
|
|
38
|
+
RsdoctorWebpackPlugin: ()=>RsdoctorWebpackPlugin,
|
|
39
|
+
defineRule: ()=>rules_namespaceObject.defineRule,
|
|
40
|
+
LinterType: ()=>rules_namespaceObject.LinterType
|
|
41
|
+
});
|
|
42
|
+
let build_utils_namespaceObject = require("@rsdoctor/core/build-utils"), plugins_namespaceObject = require("@rsdoctor/core/plugins"), graph_namespaceObject = require("@rsdoctor/graph"), sdk_namespaceObject = require("@rsdoctor/sdk"), types_namespaceObject = require("@rsdoctor/types"), build_namespaceObject = require("@rsdoctor/utils/build"), common_namespaceObject = require("@rsdoctor/utils/common"), logger_namespaceObject = require("@rsdoctor/utils/logger"), pluginTapName = 'RsdoctorWebpackPlugin', pluginTapPostOptions = {
|
|
43
|
+
name: pluginTapName,
|
|
44
|
+
stage: 999
|
|
45
|
+
}, pkg = __webpack_require__("./package.json"), external_path_namespaceObject = require("path");
|
|
46
|
+
var external_path_default = __webpack_require__.n(external_path_namespaceObject);
|
|
47
|
+
class RsdoctorWebpackPlugin {
|
|
48
|
+
name = pluginTapName;
|
|
49
|
+
options;
|
|
50
|
+
sdk;
|
|
51
|
+
isRsdoctorPlugin;
|
|
52
|
+
modulesGraph;
|
|
53
|
+
_bootstrapTask;
|
|
54
|
+
browserIsOpened = !1;
|
|
55
|
+
chunkGraph;
|
|
56
|
+
outsideInstance;
|
|
57
|
+
constructor(options){
|
|
58
|
+
this.options = (0, plugins_namespaceObject.normalizeUserConfig)(options);
|
|
59
|
+
const { port, output, innerClientPath, printLog, sdkInstance } = this.options;
|
|
60
|
+
this.sdk = sdkInstance ?? new sdk_namespaceObject.RsdoctorSDK({
|
|
61
|
+
port: port,
|
|
62
|
+
name: pluginTapName,
|
|
63
|
+
root: process.cwd(),
|
|
64
|
+
type: output.reportCodeType,
|
|
65
|
+
config: {
|
|
66
|
+
innerClientPath: innerClientPath,
|
|
67
|
+
printLog: printLog,
|
|
68
|
+
mode: output.mode,
|
|
69
|
+
brief: output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && output.options || void 0
|
|
70
|
+
}
|
|
71
|
+
}), this.modulesGraph = new graph_namespaceObject.ModuleGraph(), this.chunkGraph = new graph_namespaceObject.ChunkGraph(), this.isRsdoctorPlugin = !0;
|
|
72
|
+
}
|
|
73
|
+
apply(compiler) {
|
|
74
|
+
logger_namespaceObject.logger.greet(`
|
|
75
|
+
\nRsdoctor v${pkg.version}\n`), this._bootstrapTask || (this._bootstrapTask = this.sdk.bootstrap()), (0, plugins_namespaceObject.setSDK)(this.sdk), new plugins_namespaceObject.InternalSummaryPlugin(this).apply(compiler), this.options.features.loader && (new build_utils_namespaceObject.Loader.ProbeLoaderPlugin().apply(compiler), this.sdk.addClientRoutes([
|
|
76
|
+
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
|
|
77
|
+
]), common_namespaceObject.Loader.isVue(compiler) || new plugins_namespaceObject.InternalLoaderPlugin(this).apply(compiler)), this.options.features.resolver && new plugins_namespaceObject.InternalResolverPlugin(this).apply(compiler), this.options.features.plugins && new plugins_namespaceObject.InternalPluginsPlugin(this).apply(compiler), this.options.features.bundle && (new plugins_namespaceObject.InternalBundlePlugin(this).apply(compiler), new plugins_namespaceObject.InternalBundleTagPlugin(this).apply(compiler)), new plugins_namespaceObject.InternalErrorReporterPlugin(this).apply(compiler), new plugins_namespaceObject.InternalRulesPlugin(this).apply(compiler), new plugins_namespaceObject.InternalProgressPlugin(this).apply(compiler), compiler.hooks.afterPlugins.tap(pluginTapPostOptions, this.afterPlugins), compiler.hooks.watchRun.tapPromise(pluginTapPostOptions, this.beforeRun), compiler.hooks.beforeRun.tapPromise(pluginTapPostOptions, this.beforeRun), compiler.hooks.done.tapPromise({
|
|
78
|
+
...pluginTapPostOptions,
|
|
79
|
+
stage: pluginTapPostOptions.stage + 100
|
|
80
|
+
}, this.done.bind(this, compiler));
|
|
81
|
+
}
|
|
82
|
+
afterPlugins = (compiler)=>{
|
|
83
|
+
if (compiler.isChild()) return;
|
|
84
|
+
let configuration = (0, plugins_namespaceObject.processCompilerConfig)(compiler.options), rspackVersion = 'rspackVersion' in compiler.webpack ? compiler.webpack.rspackVersion : void 0, webpackVersion = compiler.webpack?.version;
|
|
85
|
+
this.sdk.reportConfiguration({
|
|
86
|
+
name: rspackVersion ? 'rspack' : 'webpack',
|
|
87
|
+
version: rspackVersion || webpackVersion || 'unknown',
|
|
88
|
+
config: configuration,
|
|
89
|
+
root: (0, sdk_namespaceObject.findRoot)() || ''
|
|
90
|
+
}), configuration.name && this.sdk.setName(configuration.name);
|
|
91
|
+
};
|
|
92
|
+
beforeRun = async (compiler)=>{
|
|
93
|
+
compiler.isChild() || await this._bootstrapTask.then(()=>{
|
|
94
|
+
this.options.disableClientServer || this.browserIsOpened || this.options.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] || (this.browserIsOpened = !0, this.sdk.server.openClientPage());
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
ensureModulesChunksGraphApplied(compiler) {
|
|
98
|
+
(0, plugins_namespaceObject.ensureModulesChunksGraphFn)(compiler, this);
|
|
99
|
+
}
|
|
100
|
+
done = async (compiler)=>{
|
|
101
|
+
try {
|
|
102
|
+
this.sdk.server.broadcast(), logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[Before Write Manifest]'`), this.outsideInstance && 'parent' in this.sdk && this.sdk.parent.master.setOutputDir(external_path_default().resolve(this.options.output.reportDir || compiler.outputPath, this.options.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] ? '' : `./${types_namespaceObject.Constants.RsdoctorOutputFolder}`)), this.sdk.setOutputDir(external_path_default().resolve(this.options.output.reportDir || compiler.outputPath, this.options.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] ? '' : `./${types_namespaceObject.Constants.RsdoctorOutputFolder}`)), await this.sdk.writeStore(), logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After Write Manifest]'`), this.options.disableClientServer || this.options.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && Array.isArray(this.options.output.options?.type) && 1 === this.options.output.options.type.length && 'json' === this.options.output.options.type[0] ? (await this.sdk.dispose(), logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After SDK Dispose]'`)) : this.options.output.mode !== types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] || this.options.disableClientServer || await (0, plugins_namespaceObject.handleBriefModeReport)(this.sdk, this.options, this.options.disableClientServer);
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.error("[Rsdoctor] Webpack plugin this.done error", e);
|
|
63
105
|
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
apply(compiler) {
|
|
67
|
-
this._bootstrapTask || (this._bootstrapTask = this.sdk.bootstrap()), (0, plugins_namespaceObject.setSDK)(this.sdk), new plugins_namespaceObject.InternalSummaryPlugin(this).apply(compiler), this.options.features.loader && (new build_utils_namespaceObject.Loader.ProbeLoaderPlugin().apply(compiler), this.sdk.addClientRoutes([
|
|
68
|
-
types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
|
|
69
|
-
]), common_namespaceObject.Loader.isVue(compiler) || new plugins_namespaceObject.InternalLoaderPlugin(this).apply(compiler)), this.options.features.resolver && new plugins_namespaceObject.InternalResolverPlugin(this).apply(compiler), this.options.features.plugins && new plugins_namespaceObject.InternalPluginsPlugin(this).apply(compiler), this.options.features.bundle && (new plugins_namespaceObject.InternalBundlePlugin(this).apply(compiler), new plugins_namespaceObject.InternalBundleTagPlugin(this).apply(compiler)), new plugins_namespaceObject.InternalErrorReporterPlugin(this).apply(compiler), new plugins_namespaceObject.InternalRulesPlugin(this).apply(compiler), new plugins_namespaceObject.InternalProgressPlugin(this).apply(compiler), compiler.hooks.afterPlugins.tap(pluginTapPostOptions, this.afterPlugins), compiler.hooks.watchRun.tapPromise(pluginTapPostOptions, this.beforeRun), compiler.hooks.beforeRun.tapPromise(pluginTapPostOptions, this.beforeRun), compiler.hooks.done.tapPromise({
|
|
70
|
-
...pluginTapPostOptions,
|
|
71
|
-
stage: pluginTapPostOptions.stage + 100
|
|
72
|
-
}, this.done.bind(this, compiler));
|
|
106
|
+
};
|
|
73
107
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
class RsdoctorWebpackMultiplePlugin extends RsdoctorWebpackPlugin {
|
|
109
|
+
controller;
|
|
110
|
+
constructor(options = {}){
|
|
111
|
+
const controller = (()=>{
|
|
112
|
+
if (globalController) return globalController;
|
|
113
|
+
let controller = new sdk_namespaceObject.RsdoctorSDKController();
|
|
114
|
+
return globalController = controller, controller;
|
|
115
|
+
})(), normallizedOptions = (0, plugins_namespaceObject.normalizeUserConfig)(options);
|
|
116
|
+
super({
|
|
117
|
+
...options,
|
|
118
|
+
sdkInstance: controller.createSlave({
|
|
119
|
+
name: options.name || 'Builder',
|
|
120
|
+
stage: options.stage,
|
|
121
|
+
extraConfig: {
|
|
122
|
+
innerClientPath: normallizedOptions.innerClientPath,
|
|
123
|
+
printLog: normallizedOptions.printLog,
|
|
124
|
+
mode: normallizedOptions.output.mode ? normallizedOptions.output.mode : void 0,
|
|
125
|
+
brief: normallizedOptions.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && normallizedOptions.output.options || void 0
|
|
126
|
+
},
|
|
127
|
+
type: normallizedOptions.output.reportCodeType
|
|
128
|
+
})
|
|
129
|
+
}), this.controller = controller;
|
|
130
|
+
}
|
|
131
|
+
apply(compiler) {
|
|
132
|
+
'dependencies' in compiler.options && (this.sdk.dependencies = compiler.options.dependencies), super.apply(compiler);
|
|
97
133
|
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
class RsdoctorWebpackMultiplePlugin extends RsdoctorWebpackPlugin {
|
|
101
|
-
controller;
|
|
102
|
-
constructor(options = {}){
|
|
103
|
-
const controller = (()=>{
|
|
104
|
-
if (globalController) return globalController;
|
|
105
|
-
let controller = new sdk_namespaceObject.RsdoctorSDKController();
|
|
106
|
-
return globalController = controller, controller;
|
|
107
|
-
})(), normallizedOptions = (0, plugins_namespaceObject.normalizeUserConfig)(options);
|
|
108
|
-
super({
|
|
109
|
-
...options,
|
|
110
|
-
sdkInstance: controller.createSlave({
|
|
111
|
-
name: options.name || 'Builder',
|
|
112
|
-
stage: options.stage,
|
|
113
|
-
extraConfig: {
|
|
114
|
-
innerClientPath: normallizedOptions.innerClientPath,
|
|
115
|
-
printLog: normallizedOptions.printLog,
|
|
116
|
-
mode: normallizedOptions.output.mode ? normallizedOptions.output.mode : void 0,
|
|
117
|
-
brief: normallizedOptions.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && normallizedOptions.output.options || void 0
|
|
118
|
-
},
|
|
119
|
-
type: normallizedOptions.output.reportCodeType
|
|
120
|
-
})
|
|
121
|
-
}), this.controller = controller;
|
|
122
|
-
}
|
|
123
|
-
apply(compiler) {
|
|
124
|
-
'dependencies' in compiler.options && (this.sdk.dependencies = compiler.options.dependencies), super.apply(compiler);
|
|
125
134
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
for(var __rspack_i in exports.LinterType = __webpack_exports__.LinterType, exports.RsdoctorWebpackMultiplePlugin = __webpack_exports__.RsdoctorWebpackMultiplePlugin, exports.RsdoctorWebpackPlugin = __webpack_exports__.RsdoctorWebpackPlugin, exports.defineRule = __webpack_exports__.defineRule, __webpack_exports__)-1 === [
|
|
135
|
+
let rules_namespaceObject = require("@rsdoctor/core/rules");
|
|
136
|
+
})(), exports.LinterType = __webpack_exports__.LinterType, exports.RsdoctorWebpackMultiplePlugin = __webpack_exports__.RsdoctorWebpackMultiplePlugin, exports.RsdoctorWebpackPlugin = __webpack_exports__.RsdoctorWebpackPlugin, exports.defineRule = __webpack_exports__.defineRule, __webpack_exports__)-1 === [
|
|
129
137
|
"LinterType",
|
|
130
138
|
"RsdoctorWebpackMultiplePlugin",
|
|
131
139
|
"RsdoctorWebpackPlugin",
|
package/dist/index.js
CHANGED
|
@@ -9,10 +9,22 @@ import { Loader as common_Loader } from "@rsdoctor/utils/common";
|
|
|
9
9
|
import { logger } from "@rsdoctor/utils/logger";
|
|
10
10
|
import path from "path";
|
|
11
11
|
import { LinterType, defineRule } from "@rsdoctor/core/rules";
|
|
12
|
+
var __webpack_modules__ = {
|
|
13
|
+
"./package.json" (module) {
|
|
14
|
+
module.exports = JSON.parse('{"name":"@rsdoctor/webpack-plugin","version":"1.4.0","repository":{"type":"git","url":"https://github.com/web-infra-dev/rsdoctor","directory":"packages/webpack-plugin"},"license":"MIT","main":"dist/index.cjs","types":"dist/index.d.ts","files":["dist"],"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.cjs"}},"scripts":{"dev":"npm run start","build":"rslib build","start":"rslib build -w","test":"rstest run"},"dependencies":{"@rsdoctor/core":"workspace:*","@rsdoctor/graph":"workspace:*","@rsdoctor/sdk":"workspace:*","@rsdoctor/types":"workspace:*","@rsdoctor/utils":"workspace:*"},"devDependencies":{"@types/node":"^22.8.1","@types/tapable":"2.2.7","tslib":"2.8.1","typescript":"^5.9.2","webpack":"^5.97.1"},"peerDependencies":{"webpack":"5.x"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
|
|
15
|
+
}
|
|
16
|
+
}, __webpack_module_cache__ = {};
|
|
12
17
|
let pluginTapName = 'RsdoctorWebpackPlugin', pluginTapPostOptions = {
|
|
13
18
|
name: pluginTapName,
|
|
14
19
|
stage: 999
|
|
15
|
-
}
|
|
20
|
+
}, pkg = function __webpack_require__(moduleId) {
|
|
21
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
22
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
23
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
24
|
+
exports: {}
|
|
25
|
+
};
|
|
26
|
+
return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
|
|
27
|
+
}("./package.json");
|
|
16
28
|
class RsdoctorWebpackPlugin {
|
|
17
29
|
name = pluginTapName;
|
|
18
30
|
options;
|
|
@@ -40,7 +52,8 @@ class RsdoctorWebpackPlugin {
|
|
|
40
52
|
}), this.modulesGraph = new ModuleGraph(), this.chunkGraph = new ChunkGraph(), this.isRsdoctorPlugin = !0;
|
|
41
53
|
}
|
|
42
54
|
apply(compiler) {
|
|
43
|
-
|
|
55
|
+
logger.greet(`
|
|
56
|
+
\nRsdoctor v${pkg.version}\n`), this._bootstrapTask || (this._bootstrapTask = this.sdk.bootstrap()), setSDK(this.sdk), new InternalSummaryPlugin(this).apply(compiler), this.options.features.loader && (new Loader.ProbeLoaderPlugin().apply(compiler), this.sdk.addClientRoutes([
|
|
44
57
|
Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
|
|
45
58
|
]), common_Loader.isVue(compiler) || new InternalLoaderPlugin(this).apply(compiler)), this.options.features.resolver && new InternalResolverPlugin(this).apply(compiler), this.options.features.plugins && new InternalPluginsPlugin(this).apply(compiler), this.options.features.bundle && (new InternalBundlePlugin(this).apply(compiler), new InternalBundleTagPlugin(this).apply(compiler)), new InternalErrorReporterPlugin(this).apply(compiler), new InternalRulesPlugin(this).apply(compiler), new InternalProgressPlugin(this).apply(compiler), compiler.hooks.afterPlugins.tap(pluginTapPostOptions, this.afterPlugins), compiler.hooks.watchRun.tapPromise(pluginTapPostOptions, this.beforeRun), compiler.hooks.beforeRun.tapPromise(pluginTapPostOptions, this.beforeRun), compiler.hooks.done.tapPromise({
|
|
46
59
|
...pluginTapPostOptions,
|
|
@@ -67,7 +80,7 @@ class RsdoctorWebpackPlugin {
|
|
|
67
80
|
}
|
|
68
81
|
done = async (compiler)=>{
|
|
69
82
|
try {
|
|
70
|
-
this.sdk.server.broadcast(), logger.debug(`${Process.getMemoryUsageMessage()}, '[Before Write Manifest]'`), this.outsideInstance && 'parent' in this.sdk && this.sdk.parent.master.setOutputDir(path.resolve(this.options.output.reportDir || compiler.outputPath, this.options.output.mode === SDK.IMode[SDK.IMode.brief] ? '' : `./${Constants.RsdoctorOutputFolder}`)), this.sdk.setOutputDir(path.resolve(this.options.output.reportDir || compiler.outputPath, this.options.output.mode === SDK.IMode[SDK.IMode.brief] ? '' : `./${Constants.RsdoctorOutputFolder}`)), await this.sdk.writeStore(), logger.debug(`${Process.getMemoryUsageMessage()}, '[After Write Manifest]'`), this.options.disableClientServer ? (await this.sdk.dispose(), logger.debug(`${Process.getMemoryUsageMessage()}, '[After SDK Dispose]'`)) : this.options.output.mode !== SDK.IMode[SDK.IMode.brief] || this.options.disableClientServer || handleBriefModeReport(this.sdk, this.options, this.options.disableClientServer);
|
|
83
|
+
this.sdk.server.broadcast(), logger.debug(`${Process.getMemoryUsageMessage()}, '[Before Write Manifest]'`), this.outsideInstance && 'parent' in this.sdk && this.sdk.parent.master.setOutputDir(path.resolve(this.options.output.reportDir || compiler.outputPath, this.options.output.mode === SDK.IMode[SDK.IMode.brief] ? '' : `./${Constants.RsdoctorOutputFolder}`)), this.sdk.setOutputDir(path.resolve(this.options.output.reportDir || compiler.outputPath, this.options.output.mode === SDK.IMode[SDK.IMode.brief] ? '' : `./${Constants.RsdoctorOutputFolder}`)), await this.sdk.writeStore(), logger.debug(`${Process.getMemoryUsageMessage()}, '[After Write Manifest]'`), this.options.disableClientServer || this.options.output.mode === SDK.IMode[SDK.IMode.brief] && Array.isArray(this.options.output.options?.type) && 1 === this.options.output.options.type.length && 'json' === this.options.output.options.type[0] ? (await this.sdk.dispose(), logger.debug(`${Process.getMemoryUsageMessage()}, '[After SDK Dispose]'`)) : this.options.output.mode !== SDK.IMode[SDK.IMode.brief] || this.options.disableClientServer || await handleBriefModeReport(this.sdk, this.options, this.options.disableClientServer);
|
|
71
84
|
} catch (e) {
|
|
72
85
|
console.error("[Rsdoctor] Webpack plugin this.done error", e);
|
|
73
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/webpack-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@rsdoctor/core": "1.
|
|
25
|
-
"@rsdoctor/sdk": "1.
|
|
26
|
-
"@rsdoctor/types": "1.
|
|
27
|
-
"@rsdoctor/
|
|
28
|
-
"@rsdoctor/
|
|
24
|
+
"@rsdoctor/core": "1.4.0",
|
|
25
|
+
"@rsdoctor/sdk": "1.4.0",
|
|
26
|
+
"@rsdoctor/types": "1.4.0",
|
|
27
|
+
"@rsdoctor/utils": "1.4.0",
|
|
28
|
+
"@rsdoctor/graph": "1.4.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.8.1",
|