I've got a nextjs 13 project and I need certain files (web audio api worklets from let's say ./src/worklets/*.ts
) to be compiled and bundled separately.
None of the solutions I found online worked for me.
This is as far as I've gotten
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config) => {
return Object.assign({}, config, {
entry: async () => {
const entryConfig = await config.entry();
const newEntryConfig = {
...entryConfig,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// I ASSUME I NEED TO ADD SOMETHING HERE
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
};
return newEntryConfig;
}
});
return config;
}
}
module.exports = nextConfig