@mcpc-tech/unplugin-dev-inspector-mcp 0.0.8 → 0.0.9
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 +63 -6
- package/client/dist/inspector.iife.js +5 -5
- package/dist/chunk.cjs +74 -0
- package/dist/index.cjs +814 -802
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +92 -38
- package/dist/next.cjs +31 -0
- package/dist/next.d.cts +11 -0
- package/dist/next.d.ts +11 -0
- package/dist/next.js +28 -0
- package/dist/standalone-server.cjs +104 -0
- package/dist/standalone-server.js +102 -0
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -71,7 +71,9 @@ pnpm add -D @mcpc-tech/unplugin-dev-inspector-mcp
|
|
|
71
71
|
yarn add -D @mcpc-tech/unplugin-dev-inspector-mcp
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Add DevInspector to your
|
|
74
|
+
Add DevInspector to your project:
|
|
75
|
+
|
|
76
|
+
### Vite
|
|
75
77
|
|
|
76
78
|
```diff
|
|
77
79
|
// vite.config.ts
|
|
@@ -91,9 +93,7 @@ Add DevInspector to your Vite config:
|
|
|
91
93
|
|
|
92
94
|
> ⚠️ **Plugin order matters:** Place `DevInspector.vite()` **before** `react()`, `vue()`, or `preact()`. Otherwise source locations may show `unknown:0:0`.
|
|
93
95
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
### For Non-HTML Projects (Miniapps, Library Bundles)
|
|
96
|
+
#### For Non-HTML Projects (Miniapps, Library Bundles)
|
|
97
97
|
|
|
98
98
|
If your project doesn't use HTML files (e.g., miniapp platforms that only bundle JS):
|
|
99
99
|
|
|
@@ -112,7 +112,7 @@ import 'virtual:dev-inspector-mcp'; // ← Add this import
|
|
|
112
112
|
|
|
113
113
|
**✅ Zero Production Impact:** This import is automatically removed in production builds via tree-shaking. The entire dev-inspector code is wrapped in `if (import.meta.env.DEV)` guards, which bundlers statically replace with `false` during production builds.
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
##### Custom Virtual Module Name
|
|
116
116
|
|
|
117
117
|
If `virtual:dev-inspector-mcp` conflicts with your project, you can customize it:
|
|
118
118
|
|
|
@@ -130,13 +130,70 @@ DevInspector.vite({
|
|
|
130
130
|
import 'virtual:my-custom-inspector'; // ← Use your custom name
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
+
### Webpack
|
|
134
|
+
|
|
135
|
+
```diff
|
|
136
|
+
// webpack.config.js
|
|
137
|
+
+const DevInspector = require('@mcpc-tech/unplugin-dev-inspector-mcp');
|
|
138
|
+
|
|
139
|
+
module.exports = {
|
|
140
|
+
plugins: [
|
|
141
|
+
+ DevInspector.webpack({
|
|
142
|
+
+ enabled: true,
|
|
143
|
+
+ enableMcp: true,
|
|
144
|
+
+ }),
|
|
145
|
+
],
|
|
146
|
+
};
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Next.js
|
|
150
|
+
|
|
151
|
+
```diff
|
|
152
|
+
// next.config.ts
|
|
153
|
+
+import DevInspector from '@mcpc-tech/unplugin-dev-inspector-mcp';
|
|
154
|
+
|
|
155
|
+
const nextConfig: NextConfig = {
|
|
156
|
+
+ webpack: (config) => {
|
|
157
|
+
+ config.plugins.push(
|
|
158
|
+
+ DevInspector.webpack({
|
|
159
|
+
+ enabled: true,
|
|
160
|
+
+ })
|
|
161
|
+
+ );
|
|
162
|
+
+ return config;
|
|
163
|
+
+ },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export default nextConfig;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Then add to your root layout:
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
// app/layout.tsx
|
|
173
|
+
import { DevInspector } from "@mcpc-tech/unplugin-dev-inspector-mcp/next";
|
|
174
|
+
|
|
175
|
+
export default function RootLayout({ children }) {
|
|
176
|
+
return (
|
|
177
|
+
<html>
|
|
178
|
+
<body>
|
|
179
|
+
<DevInspector />
|
|
180
|
+
{children}
|
|
181
|
+
</body>
|
|
182
|
+
</html>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
> 💡 **Note:** Webpack and Next.js use a standalone server on port 8888. Run `next dev --webpack` for Webpack mode (Next.js 16+ defaults to Turbopack).
|
|
188
|
+
|
|
189
|
+
|
|
133
190
|
## Configuration
|
|
134
191
|
|
|
135
192
|
### Auto-Update MCP Config
|
|
136
193
|
|
|
137
194
|
The plugin automatically updates MCP configuration files for detected editors when the dev server starts. This saves you from manually configuring MCP endpoints.
|
|
138
195
|
|
|
139
|
-
**Supported editors:** Cursor, VSCode, Windsurf, Claude Code
|
|
196
|
+
**Supported editors:** Cursor, VSCode, Windsurf, Claude Code, Antigravity
|
|
140
197
|
|
|
141
198
|
```typescript
|
|
142
199
|
// vite.config.ts
|