🚀 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
1.0.0

6

CHANGELOG.md
# @preconstruct/next
## 1.0.0
### Major Changes
- [`4b4e558`](https://github.com/preconstruct/preconstruct/commit/4b4e55859f5dc474f26a44716f9e258fe374837d) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Make Next use a custom Babel config even if it's in different higher directory than the Next site with `rootMode: 'upward-optional'`
## 0.1.1

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

24

index.js

@@ -5,7 +5,23 @@ module.exports = (nextConfig = {}) => {

nextConfig.webpack = (webpackConfig, options) => {
webpackConfig.module.rules.push({
test: /\.+(js|jsx|ts|tsx)$/,
use: options.defaultLoaders.babel,
exclude: modulePath => /node_modules/.test(modulePath)
let hasFoundRule = false;
options.defaultLoaders.babel.options.rootMode = "upward-optional";
debugger;
webpackConfig.module.rules.forEach(rule => {
if (
rule.use === options.defaultLoaders.babel ||
(Array.isArray(rule.use) &&
rule.use.includes(options.defaultLoaders.babel))
) {
hasFoundRule = true;
debugger;
delete rule.include;
debugger;
}
});
if (!hasFoundRule) {
throw new Error(
"If you see this error, please open an issue with your Next.js version and @preconstruct/next version. The Next Babel loader could not be found"
);
}
debugger;
return originalWebpack

@@ -12,0 +28,0 @@ ? originalWebpack(webpackConfig, options)

2

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

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