Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
46e9f48
add function to override next config
mathu97 Mar 3, 2025
e4c1966
implement next config override logic to import in existing config and…
mathu97 Mar 3, 2025
7924e7b
add unit tests for next config overrides
mathu97 Mar 4, 2025
b670497
address some comments
mathu97 Mar 5, 2025
af99265
fix test
mathu97 Mar 5, 2025
c6626f9
use rename instead of read/write
mathu97 Mar 6, 2025
4a8401a
progress - e2e tests
mathu97 Mar 6, 2025
074d6a0
mostly working e2e tests
mathu97 Mar 6, 2025
8b72920
support async next configs
mathu97 Mar 6, 2025
141d46e
debug
mathu97 Mar 6, 2025
1e98f4f
fix up e2e tests
mathu97 Mar 6, 2025
70e1bd8
add additional tests and fix lint errors
mathu97 Mar 6, 2025
442a69a
fix lint
mathu97 Mar 6, 2025
cc64e3d
some debug logs
mathu97 Mar 6, 2025
2d6718a
Merge remote-tracking branch 'origin/main' into feat/override-next-co…
mathu97 Mar 6, 2025
560f0d8
remove console logs
mathu97 Mar 7, 2025
5a1ce3c
set debuggability for e2e test
mathu97 Mar 7, 2025
9d6ee74
remove usage of libraries to fix e2e
mathu97 Mar 7, 2025
be9d381
fix e2e
mathu97 Mar 7, 2025
9797602
add jsdocs
mathu97 Mar 7, 2025
2bdecf0
bump version
mathu97 Mar 8, 2025
85cea6e
address pr comments
mathu97 Mar 8, 2025
fff3505
fix errors
mathu97 Mar 8, 2025
a2dc2eb
add validate next config override function
mathu97 Mar 8, 2025
bd62abe
just loadconfig again instead of checking anything else
mathu97 Mar 8, 2025
726342e
fix breaking tests
mathu97 Mar 10, 2025
d7ce5da
add validation that override worked
mathu97 Mar 10, 2025
ec84af3
fix tests again
mathu97 Mar 10, 2025
7055350
add overrides validation unit tests
mathu97 Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
tests:
- name: with-js-config-object-style
config: |
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'js-config-value',
},
{
key: 'x-config-type',
value: 'object',
},
],
},
];
},
};

module.exports = nextConfig;
file: next.config.js
- name: with-js-config-function-style
config: |
/** @type {import('next').NextConfig} */
const nextConfig = (phase, { defaultConfig }) => {
return {
reactStrictMode: true,
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'js-config-value',
},
{
key: 'x-config-type',
value: 'function',
},
],
},
];
}
};
};

module.exports = nextConfig;
file: next.config.js
- name: with-js-async-function
config: |
// @ts-check

module.exports = async (phase, { defaultConfig }) => {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'js-config-value',
},
{
key: 'x-config-type',
value: 'function',
},
],
},
];
}
}
return nextConfig
}
file: next.config.js
- name: with-ts-config
config: |
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'ts-config-value',
}
],
},
];
}
}

export default nextConfig
file: next.config.ts
- name: with-ecmascript-modules
config: |
// @ts-check

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'mjs-config-value',
},
],
},
];
}
}

export default nextConfig
file: next.config.mjs
- name: with-empty-config
config: |
// @ts-check

/** @type {import('next').NextConfig} */
const nextConfig = {
/* config options here */
}

module.exports = nextConfig
file: next.config.js
- name: with-images-unoptimized-false
config: |
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
unoptimized: false,
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'js-config-value',
},
{
key: 'x-config-type',
value: 'object',
},
],
},
];
},
};

module.exports = nextConfig;
file: next.config.js
- name: with-custom-image-loader
config: |
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
loader: "akamai",
path: "",
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'x-custom-header',
value: 'js-config-value',
},
{
key: 'x-config-type',
value: 'object',
},
],
},
];
},
};

module.exports = nextConfig;
file: next.config.js
Loading
Loading