Answer the question
In order to leave comments, you need to log in
How to configure config in next?
Good day.
The original config was:
module.exports = {
async redirects() {
return [
{
source: '/signup',
destination: '/sign-up',
permanent: true,
},
];
},
};
module.exports = (phase) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
return {
env: {
test: 'hello',
},
};
}
return {
env: {
test: 'hello world',
},
};
};
Answer the question
In order to leave comments, you need to log in
module.exports = (phase, { defaultConfig }) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
return {
...defaultConfig,
future: {
webpack5: true,
},
redirects: async () => {
return [
{
source: '/sign-up',
destination: '/signup',
permanent: true,
},
];
},
env: {
test: 'hello',
},
};
}
return {
/* config options for all phases except development here */
};
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question