Skip to content

Commit 14a0884

Browse files
committed
Fix next warnings when building starter project
1 parent be61ba5 commit 14a0884

File tree

4 files changed

+25
-29
lines changed

4 files changed

+25
-29
lines changed

.changeset/thick-tomatoes-pretend.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solana/wallet-adapter-example': minor
3+
---
4+
5+
Fix next.js warnings when building starter project
+20-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
/* eslint-disable @typescript-eslint/no-var-requires */
2-
const plugins = require('next-compose-plugins');
3-
const antdLess = require('next-plugin-antd-less');
1+
const withAntdLess = require('next-plugin-antd-less');
42
const { PHASE_PRODUCTION_BUILD } = require('next/constants');
53

6-
module.exports = function (phase, ...args) {
7-
return plugins(
8-
[
9-
[
10-
antdLess,
11-
{
12-
modifyVars: {
13-
'@background': '#303030',
14-
'@primary-color': '#512da8',
15-
},
16-
},
17-
],
18-
],
19-
{
20-
reactStrictMode: true,
21-
basePath: phase === PHASE_PRODUCTION_BUILD ? '/wallet-adapter/example' : '',
22-
}
23-
)(phase, ...args);
4+
const COLORS = {
5+
GREY: '#303030',
6+
PURPLE: '#512da8',
7+
};
8+
9+
module.exports = function (phase, { defaultConfig }) {
10+
// See https://github.com/SolidZORO/next-plugin-antd-less
11+
const config = withAntdLess({
12+
// Note this produces an unnecessary warning:
13+
// 'The root value has an unexpected property, modifyVars'
14+
// See https://github.com/SolidZORO/next-plugin-antd-less/issues/105
15+
modifyVars: {
16+
'@background': COLORS.GREY,
17+
'@primary-color': COLORS.PURPLE,
18+
},
19+
basePath: phase === PHASE_PRODUCTION_BUILD ? '/wallet-adapter/example' : '',
20+
});
21+
22+
return config;
2423
};

packages/starter/example/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"@types/react-dom": "^18.0.11",
6262
"eslint": "8.22.0",
6363
"eslint-config-next": "^12.3.4",
64-
"next-compose-plugins": "^2.2.1",
6564
"next-plugin-antd-less": "^1.8.0",
6665
"prettier": "^2.8.4",
6766
"shx": "^0.3.4",

pnpm-lock.yaml

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)