react-reinspect 0.1.4 → 0.1.6
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
CHANGED
|
@@ -100,7 +100,7 @@ You are a senior React code agent, your task is to integrate react-reinspect to
|
|
|
100
100
|
|
|
101
101
|
Do all of the following in one pass:
|
|
102
102
|
1) Install `react-reinspect` using this repo's package manager.
|
|
103
|
-
2) Turn it on in dev mode ONLY by wiring `ReinspectProvider` at app root.
|
|
103
|
+
2) Turn it on in dev mode ONLY by wiring `ReinspectProvider` at app root (on CLIENT SIDE only, not server-rendered!).
|
|
104
104
|
- Vite: use `enabled: import.meta.env.DEV`
|
|
105
105
|
- Next.js: use `enabled: process.env.NODE_ENV !== 'production'`
|
|
106
106
|
- Next App Router: mount a client `Providers` component from `app/layout.tsx`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { shouldSkipThirdPartyModule, transformModuleForAutoDiscover, } from './reinspectAutoDiscoverPlugin';
|
|
2
|
+
import { shouldSkipThirdPartyModule, transformModuleForAutoDiscover, } from './reinspectAutoDiscoverPlugin.js';
|
|
3
3
|
const SUPPORTED_FILE_PATTERN = /\.[cm]?[jt]sx?$/;
|
|
4
4
|
function normalizeModuleId(id) {
|
|
5
5
|
return id.split(path.sep).join('/');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reinspectNextPlugin.d.ts","sourceRoot":"","sources":["../../src/plugin/reinspectNextPlugin.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,UAAU,kBAAkB;IAC1B,GAAG,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"reinspectNextPlugin.d.ts","sourceRoot":"","sources":["../../src/plugin/reinspectNextPlugin.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,UAAU,kBAAkB;IAC1B,GAAG,EAAE,OAAO,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,UAAU,mBAAmB;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE;QACR,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,CAAA;CACF;AAED,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,mBAAmB,GAAG,mBAAmB,EAAE,CAAA;CAClD;AAED,UAAU,uBAAuB;IAC/B,KAAK,CAAC,EAAE,eAAe,EAAE,CAAA;CAC1B;AAED,UAAU,iBAAiB;IACzB,MAAM,CAAC,EAAE,uBAAuB,CAAA;CACjC;AAED,KAAK,mBAAmB,GAAG,CACzB,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,kBAAkB,KACxB,iBAAiB,CAAA;AAEtB,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAC9B;AAqED,wBAAgB,yBAAyB,CACvC,UAAU,GAAE,cAAmB,EAC/B,aAAa,GAAE,0BAA+B,GAC7C,cAAc,CAsBhB"}
|
|
@@ -60,7 +60,8 @@ export function withReinspectAutoDiscover(nextConfig = {}, pluginOptions = {}) {
|
|
|
60
60
|
const resolvedConfig = typeof originalWebpack === 'function'
|
|
61
61
|
? originalWebpack(config, options) ?? config
|
|
62
62
|
: config;
|
|
63
|
-
const shouldEnable = options.dev || Boolean(pluginOptions.enableInProduction)
|
|
63
|
+
const shouldEnable = (options.dev || Boolean(pluginOptions.enableInProduction)) &&
|
|
64
|
+
!Boolean(options.isServer);
|
|
64
65
|
if (!shouldEnable) {
|
|
65
66
|
return resolvedConfig;
|
|
66
67
|
}
|