@reticlehq/next 3.1.0 → 3.2.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.
Files changed (2) hide show
  1. package/index.cjs +6 -1
  2. package/package.json +2 -2
package/index.cjs CHANGED
@@ -162,7 +162,12 @@ const LOADER_MODULE = '@reticlehq/next/loader';
162
162
  */
163
163
  function supportsTurbopackKey() {
164
164
  try {
165
- const { version } = require('next/package.json');
165
+ // From the APP, for the reason `resolveFromApp` records below: a bare require resolves against
166
+ // THIS package, so the version read could be some other copy of Next than the one about to run.
167
+ // Reading an older one returns false, no `turbopack` key is emitted, and on Next 16 — where
168
+ // Turbopack is the default — a config with a `webpack` key and no `turbopack` key is a hard
169
+ // `next dev` startup error. That is the failure the key exists to prevent.
170
+ const { version } = require(resolveFromApp('next/package.json'));
166
171
  const [major, minor] = String(version)
167
172
  .split('.')
168
173
  .map((n) => parseInt(n, 10));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/next",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Next.js helper for Reticle: keeps SWC, adds source-file mapping via a dev-only webpack pre-loader (data-reticle-source).",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Reticle contributors",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@babel/core": "^7.26.0",
41
- "@reticlehq/babel-plugin": "3.1.0"
41
+ "@reticlehq/babel-plugin": "3.2.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "next": ">=13"