🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@preconstruct/next

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preconstruct/next - npm Package Compare versions

Comparing version

to
4.0.0

6

CHANGELOG.md
# @preconstruct/next
## 4.0.0
### Major Changes
- [`8b740fe`](https://github.com/preconstruct/preconstruct/commit/8b740fe81e55a3ca0395b36b55a949544147c2cc) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - `@preconstruct/next` now makes Next.js prefer the `module` field over the `main` for server-side bundles. This is different to the behaviour that Next.js provides by default, for that reason, this change is happening in a major release of `@preconstruct/next`. The `module` field is generally regarded by most package authors and tools like Preconstruct to only indicate module format and not Node vs browser. This resolves issues with using `preconstruct dev` with packages that have dependencies that ship Node ESM(in addition to CommonJS).
## 3.0.1

@@ -4,0 +10,0 @@

@@ -39,2 +39,9 @@ "use strict";

if (options.isServer) {
webpackConfig.resolve.mainFields = [
"module",
...webpackConfig.resolve.mainFields.filter((x) => x !== "module"),
];
}
return originalWebpack

@@ -41,0 +48,0 @@ ? originalWebpack(webpackConfig, options)

2

package.json
{
"name": "@preconstruct/next",
"version": "3.0.1",
"version": "4.0.0",
"description": "A Next.js plugin to work with preconstruct repos",

@@ -5,0 +5,0 @@ "files": [

@@ -20,1 +20,8 @@ # @preconstruct/next

```
Note that in Next.js 12, Next will not read a Babel config from outside of the directory that the Next.js site is in. If you need it to to read your babel config, you will need to do something like this:
```js
// site/babel.config.js
module.exports = require("../babel.config");
```