How to achieve following using turbopack?
Unanswered
Faizan posted this in #help-forum
FaizanOP
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,
JSON.stringify(appConfig)
);
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
config: path.resolve(dirname,
},
},
};
},
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),},
},
};
},