Jump to content

Problem Webpack Always Pack Non Production File


igrir
 Share

Recommended Posts

Greetings everyone,

I'm still quite new in using NPM and has a problem to utilize the tools into Phaser 3 development. I downloaded the project template from here: https://github.com/photonstorm/phaser3-project-template, and run the webpack command. The "packing" itself was succeed and my browser show the desired canvas. After I looked on "build" folder, I noticed the file size of project.bundle.js was 5.277 KB! That's very big. I opened it up in text editor and found the bundled scripts wasn't the minified one.

besar.PNG.6a73ae266016a17bb2f4a5334783b811.PNG

I tried to build Phaser in node_modules using  `npm run dist` and rebuild my project, but the result was the same.

I also tried to added this code into my webpack config:

new webpack.LoaderOptionsPlugin({
options: {
optimization: {
minimizer: [new uglifyjs()]
},
mode: "production"
}
}),

but the result is also still the same, the build will thrown a 5.277 KB bundled file.

How do I change the packing into the minified ones? Is it just by modifying the webpack config or is that any special command to use?

Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...