Restart dev server on .env.* file changes #59558
Replies: 6 comments 2 replies
-
I am on |
Beta Was this translation helpful? Give feedback.
-
Looking for this exact feature. Use Case: Import Example: @import "@/scss/themes/brands/colors" Config Example Below: const nextConfig = {
reactStrictMode: true,
webpack: (config, options) => {
config.plugins.push(
new CopyPlugin({
patterns: [
{
from: `src/scss/themes/${process.env.NEXT_PUBLIC_BRAND}`,
to: '../src/scss/themes/brand',
force: true,
},
],
})
);
return config;
},
};
module.exports = nextConfig; |
Beta Was this translation helpful? Give feedback.
-
Does this discussion open yet? |
Beta Was this translation helpful? Give feedback.
-
Yeap
…On Fri, 15 Mar 2024, 21:19 Yinebeb Tariku, ***@***.***> wrote:
Does this discussion open yet?
—
Reply to this email directly, view it on GitHub
<#59558 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOGKJIMKWOBEW3WMYE4QBADYYMYEDAVCNFSM6AAAAABASVB37KVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DQMBVGI4DS>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Is there any progress on this? it can be a bit problematic when |
Beta Was this translation helpful? Give feedback.
-
Why not allow the custom file names to be listed in next.config.js that restart the server on any change in them? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
.env.*
files.Non-Goals
No response
Background
Currently, the Next.js dev server restarts when changes are detected in
next.config.js
. However, when.env.*
files are modified, the dev server does not automatically restart. This can lead to a suboptimal developer experience as manual restarts are required to apply the updated configuration.Proposal
Implement a mechanism in the Next.js dev server to detect changes in
.env.*
files and trigger an automatic restart when such changes are detected. This ensures that any modifications to environment variables are immediately reflected in the running development server without the need for manual intervention.Beta Was this translation helpful? Give feedback.
All reactions