Total Next.js build with the same name
Unanswered
Sporting Lucas Terrier posted this in #help-forum
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
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@@ts-ignore 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`
Sporting Lucas TerrierOP
Thank you! I'll give this a try. If you come across any other methods or have additional suggestions, please let me know. TIA!
sure