@rsdoctor/webpack-plugin 1.5.3 → 1.5.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.
@@ -4,4 +4,51 @@ 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;
7
+ export declare const pkg: {
8
+ name: string;
9
+ version: string;
10
+ repository: {
11
+ type: string;
12
+ url: string;
13
+ directory: string;
14
+ };
15
+ license: string;
16
+ main: string;
17
+ types: string;
18
+ files: string[];
19
+ type: string;
20
+ exports: {
21
+ ".": {
22
+ types: string;
23
+ import: string;
24
+ default: string;
25
+ };
26
+ };
27
+ scripts: {
28
+ dev: string;
29
+ build: string;
30
+ start: string;
31
+ test: string;
32
+ };
33
+ dependencies: {
34
+ "@rsdoctor/core": string;
35
+ "@rsdoctor/graph": string;
36
+ "@rsdoctor/sdk": string;
37
+ "@rsdoctor/types": string;
38
+ "@rsdoctor/utils": string;
39
+ };
40
+ devDependencies: {
41
+ "@types/node": string;
42
+ "@types/tapable": string;
43
+ tslib: string;
44
+ typescript: string;
45
+ webpack: string;
46
+ };
47
+ peerDependencies: {
48
+ webpack: string;
49
+ };
50
+ publishConfig: {
51
+ access: string;
52
+ registry: string;
53
+ };
54
+ };
package/dist/index.cjs CHANGED
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
+ let globalController;
2
3
  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.5.3","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.105.3"},"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
- }
4
+ var __webpack_require__ = {};
16
5
  __webpack_require__.n = (module)=>{
17
6
  var getter = module && module.__esModule ? ()=>module.default : ()=>module;
18
7
  return __webpack_require__.d(getter, {
@@ -31,113 +20,119 @@ __webpack_require__.n = (module)=>{
31
20
  });
32
21
  };
33
22
  var __webpack_exports__ = {};
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
- let hasGreeted = !1;
48
- class RsdoctorWebpackPlugin {
49
- name = pluginTapName;
50
- options;
51
- sdk;
52
- isRsdoctorPlugin;
53
- modulesGraph;
54
- _bootstrapTask;
55
- browserIsOpened = !1;
56
- chunkGraph;
57
- outsideInstance;
58
- constructor(options){
59
- this.options = (0, plugins_namespaceObject.normalizeUserConfig)(options);
60
- const { port, output, innerClientPath, printLog, sdkInstance } = this.options;
61
- this.sdk = sdkInstance ?? new sdk_namespaceObject.RsdoctorSDK({
62
- port: port,
63
- name: pluginTapName,
64
- root: process.cwd(),
65
- type: output.reportCodeType,
66
- config: {
67
- innerClientPath: innerClientPath,
68
- printLog: printLog,
69
- mode: output.mode,
70
- brief: output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && output.options || void 0,
71
- features: {
72
- treeShaking: this.options.features.treeShaking
73
- }
23
+ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
24
+ RsdoctorWebpackMultiplePlugin: ()=>RsdoctorWebpackMultiplePlugin,
25
+ RsdoctorWebpackPlugin: ()=>RsdoctorWebpackPlugin,
26
+ defineRule: ()=>rules_namespaceObject.defineRule,
27
+ LinterType: ()=>rules_namespaceObject.LinterType
28
+ });
29
+ const 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");
30
+ var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/webpack-plugin","version":"1.5.4","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.3.0","tslib":"2.8.1","typescript":"^5.9.2","webpack":"^5.105.4"},"peerDependencies":{"webpack":"5.x"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
31
+ const pluginTapName = 'RsdoctorWebpackPlugin', pluginTapPostOptions = {
32
+ name: pluginTapName,
33
+ stage: 999
34
+ }, pluginTapPreOptions = null, internalPluginTapPreOptions = (namespace)=>({
35
+ name: `${pluginTapName}:${namespace}`,
36
+ stage: -998
37
+ }), internalPluginTapPostOptions = (namespace)=>({
38
+ name: `${pluginTapName}:${namespace}`,
39
+ stage: 1000
40
+ }), pkg = package_namespaceObject, external_path_namespaceObject = require("path");
41
+ var external_path_default = __webpack_require__.n(external_path_namespaceObject);
42
+ let hasGreeted = !1;
43
+ class RsdoctorWebpackPlugin {
44
+ name = pluginTapName;
45
+ options;
46
+ sdk;
47
+ isRsdoctorPlugin;
48
+ modulesGraph;
49
+ _bootstrapTask;
50
+ browserIsOpened = !1;
51
+ chunkGraph;
52
+ outsideInstance;
53
+ constructor(options){
54
+ this.options = (0, plugins_namespaceObject.normalizeUserConfig)(options);
55
+ const { port, output, innerClientPath, printLog, sdkInstance } = this.options;
56
+ this.sdk = sdkInstance ?? new sdk_namespaceObject.RsdoctorSDK({
57
+ port: port,
58
+ name: pluginTapName,
59
+ root: process.cwd(),
60
+ type: output.reportCodeType,
61
+ config: {
62
+ innerClientPath: innerClientPath,
63
+ printLog: printLog,
64
+ mode: output.mode,
65
+ brief: output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && output.options || void 0,
66
+ features: {
67
+ treeShaking: this.options.features.treeShaking
74
68
  }
75
- }), this.modulesGraph = new graph_namespaceObject.ModuleGraph(), this.chunkGraph = new graph_namespaceObject.ChunkGraph(), this.isRsdoctorPlugin = !0;
76
- }
77
- apply(compiler) {
78
- hasGreeted || compiler.isChild() || (hasGreeted = !0, logger_namespaceObject.logger.greet(`
79
- \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([
80
- types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
81
- ]), 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({
82
- ...pluginTapPostOptions,
83
- stage: pluginTapPostOptions.stage + 100
84
- }, this.done.bind(this, compiler));
85
- }
86
- afterPlugins = (compiler)=>{
87
- if (compiler.isChild()) return;
88
- let configuration = (0, plugins_namespaceObject.processCompilerConfig)(compiler.options), rspackVersion = 'rspackVersion' in compiler.webpack ? compiler.webpack.rspackVersion : void 0, webpackVersion = compiler.webpack?.version;
89
- this.sdk.reportConfiguration({
90
- name: rspackVersion ? 'rspack' : 'webpack',
91
- version: rspackVersion || webpackVersion || 'unknown',
92
- config: configuration,
93
- root: (0, sdk_namespaceObject.findRoot)() || ''
94
- }), configuration.name && this.sdk.setName(configuration.name);
95
- };
96
- beforeRun = async (compiler)=>{
97
- compiler.isChild() || await this._bootstrapTask.then(()=>{
98
- 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());
99
- });
100
- };
101
- ensureModulesChunksGraphApplied(compiler) {
102
- (0, plugins_namespaceObject.ensureModulesChunksGraphFn)(compiler, this);
103
- }
104
- done = async (compiler)=>{
105
- try {
106
- 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);
107
- } catch (e) {
108
- console.error("[Rsdoctor] Webpack plugin this.done error", e);
109
69
  }
110
- };
70
+ }), this.modulesGraph = new graph_namespaceObject.ModuleGraph(), this.chunkGraph = new graph_namespaceObject.ChunkGraph(), this.isRsdoctorPlugin = !0;
111
71
  }
112
- class RsdoctorWebpackMultiplePlugin extends RsdoctorWebpackPlugin {
113
- controller;
114
- constructor(options = {}){
115
- const controller = (()=>{
116
- if (globalController) return globalController;
117
- let controller = new sdk_namespaceObject.RsdoctorSDKController();
118
- return globalController = controller, controller;
119
- })(), normallizedOptions = (0, plugins_namespaceObject.normalizeUserConfig)(options), instance = controller.createSlave({
120
- name: options.name || 'Builder',
121
- stage: options.stage,
122
- extraConfig: {
123
- innerClientPath: normallizedOptions.innerClientPath,
124
- printLog: normallizedOptions.printLog,
125
- mode: normallizedOptions.output.mode ? normallizedOptions.output.mode : void 0,
126
- brief: normallizedOptions.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && normallizedOptions.output.options || void 0
127
- },
128
- type: normallizedOptions.output.reportCodeType
129
- });
130
- super({
131
- ...options,
132
- sdkInstance: instance
133
- }), this.controller = controller;
134
- }
135
- apply(compiler) {
136
- 'dependencies' in compiler.options && (this.sdk.dependencies = compiler.options.dependencies), super.apply(compiler);
72
+ apply(compiler) {
73
+ hasGreeted || compiler.isChild() || (hasGreeted = !0, logger_namespaceObject.logger.greet(`
74
+ \nRsdoctor v${package_namespaceObject.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([
75
+ types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
76
+ ]), 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({
77
+ ...pluginTapPostOptions,
78
+ stage: pluginTapPostOptions.stage + 100
79
+ }, this.done.bind(this, compiler));
80
+ }
81
+ afterPlugins = (compiler)=>{
82
+ if (compiler.isChild()) return;
83
+ let configuration = (0, plugins_namespaceObject.processCompilerConfig)(compiler.options), rspackVersion = 'rspackVersion' in compiler.webpack ? compiler.webpack.rspackVersion : void 0, webpackVersion = compiler.webpack?.version;
84
+ this.sdk.reportConfiguration({
85
+ name: rspackVersion ? 'rspack' : 'webpack',
86
+ version: rspackVersion || webpackVersion || 'unknown',
87
+ config: configuration,
88
+ root: (0, sdk_namespaceObject.findRoot)() || ''
89
+ }), configuration.name && this.sdk.setName(configuration.name);
90
+ };
91
+ beforeRun = async (compiler)=>{
92
+ compiler.isChild() || await this._bootstrapTask.then(()=>{
93
+ 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());
94
+ });
95
+ };
96
+ ensureModulesChunksGraphApplied(compiler) {
97
+ (0, plugins_namespaceObject.ensureModulesChunksGraphFn)(compiler, this);
98
+ }
99
+ done = async (compiler)=>{
100
+ try {
101
+ 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);
102
+ } catch (e) {
103
+ console.error("[Rsdoctor] Webpack plugin this.done error", e);
137
104
  }
105
+ };
106
+ }
107
+ class RsdoctorWebpackMultiplePlugin extends RsdoctorWebpackPlugin {
108
+ controller;
109
+ constructor(options = {}){
110
+ const controller = (()=>{
111
+ if (globalController) return globalController;
112
+ let controller = new sdk_namespaceObject.RsdoctorSDKController();
113
+ return globalController = controller, controller;
114
+ })(), normallizedOptions = (0, plugins_namespaceObject.normalizeUserConfig)(options), instance = controller.createSlave({
115
+ name: options.name || 'Builder',
116
+ stage: options.stage,
117
+ extraConfig: {
118
+ innerClientPath: normallizedOptions.innerClientPath,
119
+ printLog: normallizedOptions.printLog,
120
+ mode: normallizedOptions.output.mode ? normallizedOptions.output.mode : void 0,
121
+ brief: normallizedOptions.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief] && normallizedOptions.output.options || void 0
122
+ },
123
+ type: normallizedOptions.output.reportCodeType
124
+ });
125
+ super({
126
+ ...options,
127
+ sdkInstance: instance
128
+ }), this.controller = controller;
138
129
  }
139
- let rules_namespaceObject = require("@rsdoctor/core/rules");
140
- })(), exports.LinterType = __webpack_exports__.LinterType, exports.RsdoctorWebpackMultiplePlugin = __webpack_exports__.RsdoctorWebpackMultiplePlugin, exports.RsdoctorWebpackPlugin = __webpack_exports__.RsdoctorWebpackPlugin, exports.defineRule = __webpack_exports__.defineRule, __webpack_exports__)-1 === [
130
+ apply(compiler) {
131
+ 'dependencies' in compiler.options && (this.sdk.dependencies = compiler.options.dependencies), super.apply(compiler);
132
+ }
133
+ }
134
+ const rules_namespaceObject = require("@rsdoctor/core/rules");
135
+ 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 === [
141
136
  "LinterType",
142
137
  "RsdoctorWebpackMultiplePlugin",
143
138
  "RsdoctorWebpackPlugin",
package/dist/index.js CHANGED
@@ -8,23 +8,11 @@ import { Process } from "@rsdoctor/utils/build";
8
8
  import { Loader as common_Loader } from "@rsdoctor/utils/common";
9
9
  import { logger } from "@rsdoctor/utils/logger";
10
10
  import path from "path";
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.5.3","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.105.3"},"peerDependencies":{"webpack":"5.x"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
15
- }
16
- }, __webpack_module_cache__ = {};
11
+ var package_namespaceObject = JSON.parse('{"name":"@rsdoctor/webpack-plugin","version":"1.5.4","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.3.0","tslib":"2.8.1","typescript":"^5.9.2","webpack":"^5.105.4"},"peerDependencies":{"webpack":"5.x"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"}}');
17
12
  let pluginTapName = 'RsdoctorWebpackPlugin', pluginTapPostOptions = {
18
13
  name: pluginTapName,
19
14
  stage: 999
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"), hasGreeted = !1;
15
+ }, hasGreeted = !1;
28
16
  class RsdoctorWebpackPlugin {
29
17
  name = pluginTapName;
30
18
  options;
@@ -56,7 +44,7 @@ class RsdoctorWebpackPlugin {
56
44
  }
57
45
  apply(compiler) {
58
46
  hasGreeted || compiler.isChild() || (hasGreeted = !0, logger.greet(`
59
- \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([
47
+ \nRsdoctor v${package_namespaceObject.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([
60
48
  Manifest.RsdoctorManifestClientRoutes.WebpackLoaders
61
49
  ]), 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({
62
50
  ...pluginTapPostOptions,
@@ -116,4 +104,5 @@ class RsdoctorWebpackMultiplePlugin extends RsdoctorWebpackPlugin {
116
104
  'dependencies' in compiler.options && (this.sdk.dependencies = compiler.options.dependencies), super.apply(compiler);
117
105
  }
118
106
  }
119
- export { LinterType, RsdoctorWebpackMultiplePlugin, RsdoctorWebpackPlugin, defineRule };
107
+ export { LinterType, defineRule } from "@rsdoctor/core/rules";
108
+ export { RsdoctorWebpackMultiplePlugin, RsdoctorWebpackPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/webpack-plugin",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -21,18 +21,18 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@rsdoctor/core": "1.5.3",
25
- "@rsdoctor/graph": "1.5.3",
26
- "@rsdoctor/sdk": "1.5.3",
27
- "@rsdoctor/types": "1.5.3",
28
- "@rsdoctor/utils": "1.5.3"
24
+ "@rsdoctor/core": "1.5.4",
25
+ "@rsdoctor/graph": "1.5.4",
26
+ "@rsdoctor/sdk": "1.5.4",
27
+ "@rsdoctor/types": "1.5.4",
28
+ "@rsdoctor/utils": "1.5.4"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.8.1",
32
- "@types/tapable": "2.2.7",
32
+ "@types/tapable": "2.3.0",
33
33
  "tslib": "2.8.1",
34
34
  "typescript": "^5.9.2",
35
- "webpack": "^5.105.3"
35
+ "webpack": "^5.105.4"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "webpack": "5.x"