Some questions about Webpack4 compiler

I no longer use webpack4 for long time, but I tried to use webpack4 packaging project for fun. And I found that the performance was so poor. One empty scene ,FPS less than 50, it shocked me the result. Is the new version BabylonJs casusing the problem? Because i used to create project with V4.20 and Webpack4, it worded very well.

Have you tried using Raanan’s package as a starting point? The performance in my experience is good. 55+ unless there’s lot going on.

cc @RaananW

Webpack 4 doesn’t support es6, so you need to use babel in order to transform the code to fit the bundler. Which means that you need to transform the code to something different. It is possible that some transformers (like the babel-minify package, as an example) hurt performance. I wouldn’t recommend using webpack 4 for a new project. Of course there are ways to solve this “fighting” webpack and babel with their default configuration. That would require you sharing your project. But if you can move to something newer - that would be my first recommendation.

1 Like