Next.js Discord

Discord Forum
. Any ideas or suggestions on customizing webpack for this scenario?#vercel-help #help-forum #resources","dateCreated":"2023-12-22T10:06:45.000Z","answerCount":5,"author":{"@type":"Person","name":"Sporting Lucas Terrier"},"suggestedAnswer":{"@type":"Answer","text":"This isn't possible with nextjs","url":"https://nextjs-forum.com/post/1187697729787396107#message-1187698873372770314","dateCreated":"2023-12-22T10:11:18.000Z","author":{"@type":"Person","name":"@ts-ignore"}}}}

Total Next.js build with the same name

Unanswered
Sporting Lucas Terrier posted this in #help-forum
Open in Discord
Sporting Lucas TerrierOP
Hello everyone, I'm currently working on a Next.js project and I'm attempting to consolidate the entire project build into a single file, say 'build.js.' Despite my efforts with custom webpack configurations, I've encountered some challenges. Can you provide guidance on how to achieve this?

Moreover, I plan to use this 'build.js' file in another Angular project to render the Next.js application. Specifically, I intend to include it in a script tag like this: <script src="/build.js"></script>. Any ideas or suggestions on customizing webpack for this scenario?
#vercel-help #help-forum #resources

5 Replies

@@ts-ignore This isn't possible with nextjs
Sporting Lucas TerrierOP
Why is it not possible? In React, we can achieve this by customizing the 'react-scripts' npm package, right? Are there similar approaches or methods for achieving this in Next.js?
@Sporting Lucas Terrier Why is it not possible? In React, we can achieve this by customizing the 'react-scripts' npm package, right? Are there similar approaches or methods for achieving this in Next.js?
Nextjs comes with its own webpack config which compiles everything and it creates different js files, I don't really think you can override that but if you want you can give it a shot. You can [Patch Package](https://www.npmjs.com/package/patch-package) and edit the next from node_modules
sure