webpack-plugin-webmcp-nexus 0.1.10 → 0.1.12

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.en.md CHANGED
@@ -34,7 +34,7 @@ Used together with [`webmcp-nexus-sdk`](https://www.npmjs.com/package/webmcp-nex
34
34
 
35
35
  ## Features
36
36
 
37
- - 📦 **Webpack 5+ support** — auto-injects the Loader into `compiler.options.module.rules`; no manual `use` configuration required.
37
+ - 📦 **Webpack 4+ / 5+ support** — auto-injects the Loader into `compiler.options.module.rules`; no manual `use` configuration required.
38
38
  - 🔬 **Types as schema** — function signatures + JSDoc are turned into JSON Schema; one source of truth.
39
39
  - 🛠️ **Automatic alias merging** — picks up Webpack's `resolve.alias` (object or array form) and lets you extend it.
40
40
  - 📂 **Flexible `include` configuration** — accept multiple directory prefixes to scope analysis.
package/README.md CHANGED
@@ -34,7 +34,7 @@
34
34
 
35
35
  ## 核心特性
36
36
 
37
- - 📦 **支持 Webpack 5+** —— 通过 `compiler.options.module.rules` 自动注入 Loader,无需手动配置 `use`。
37
+ - 📦 **支持 Webpack 4+ / 5+** —— 通过 `compiler.options.module.rules` 自动注入 Loader,无需手动配置 `use`。
38
38
  - 🔬 **类型即 Schema** —— 函数签名 + JSDoc 自动生成 JSON Schema,单一事实源。
39
39
  - 🛠️ **Alias 自动合并** —— 自动读取 Webpack 的 `resolve.alias`(对象与数组形式皆可),并允许用户额外配置。
40
40
  - 📂 **灵活的 include 配置** —— 可指定多个目录前缀,仅扫描你关心的源码。
package/dist/loader.js CHANGED
@@ -27,7 +27,8 @@ var import_webmcp_nexus_core = require("webmcp-nexus-core");
27
27
  var isDebug = () => (process.env.DEBUG ?? "").toLowerCase().includes("webmcp");
28
28
  function webmcpLoader(source) {
29
29
  const filePath = this.resourcePath;
30
- const options = this.getOptions() ?? {};
30
+ const raw = typeof this.getOptions === "function" ? this.getOptions() : this.query;
31
+ const options = raw && typeof raw === "object" ? raw : {};
31
32
  if (isDebug()) {
32
33
  console.log(`[webmcp] loader processing: ${filePath}`);
33
34
  }
package/dist/loader.mjs CHANGED
@@ -5,7 +5,8 @@ import { transformCode } from "webmcp-nexus-core";
5
5
  var isDebug = () => (process.env.DEBUG ?? "").toLowerCase().includes("webmcp");
6
6
  function webmcpLoader(source) {
7
7
  const filePath = this.resourcePath;
8
- const options = this.getOptions() ?? {};
8
+ const raw = typeof this.getOptions === "function" ? this.getOptions() : this.query;
9
+ const options = raw && typeof raw === "object" ? raw : {};
9
10
  if (isDebug()) {
10
11
  console.log(`[webmcp] loader processing: ${filePath}`);
11
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-plugin-webmcp-nexus",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Webpack plugin for WebMCP Nexus - auto-generates and injects JSON Schema from TypeScript tool definitions at build time",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -37,10 +37,10 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "webmcp-nexus-core": "0.1.10"
40
+ "webmcp-nexus-core": "0.1.12"
41
41
  },
42
42
  "peerDependencies": {
43
- "webpack": "^5.0.0"
43
+ "webpack": "^4.0.0 || ^5.0.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^24.12.2",