Next.js Discord

Discord Forum

How to achieve following using turbopack?

Unanswered
Faizan posted this in #help-forum
Open in Discord
Currently I am using webpack in my project and extending it in next config file to inject config, wondering if using turbopack its going to be possible or not.

webpack: (config, { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }) => {
// needed this as config.js by default only support server component, hence this code is added
fs.writeFileSync(
path.resolve(dirname, ./${distDir}/config.json),
JSON.stringify(appConfig)
);
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
config: path.resolve(
dirname, ./${distDir}/config.json),
},
},
};
},

0 Replies