Answer the question
In order to leave comments, you need to log in
Is it possible to wean Webpack from eval()?
Is there a plugin or setting of the webpack itself that will allow you to create a bundle that will only include js files that have been imported to the entry point, but without the eval () wrapper. That is, an analogue of MiniCssExtractPlugin, but to change the structure of the js-bundle. Or, as a last resort, I would create a separate js file.
The fact is that I am building an SSR project and initializing scripts are written on different pages that cannot reach the bundle due to the eval () context.
I would not want to use a dirty hack inside eval() and add a common bundle script to the global object on the window.onload event. I also don’t really want to put scripts for all pages into the bundle and dispatch them depending on the url.
I understand that Webpack is mainly for SPA, but maybe there is a neat solution for server rendering as well?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question