Jump to content

Problem Webpack Always Pack Non Production File


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.


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?


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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