1

I have laravel-vue stack for my project. While building with mix it splits codes into two main files

vendor.js
app.js

Apart from that there are around 60 files which gets created as chunks like

0.js
1.js
2.js
...

61.js

How to tell webpack to bind these chunks into single file. Does the webpack breaks into chunks for each new component in cue?

1
  • It would be great to see your webpack config Commented May 31, 2020 at 19:11

1 Answer 1

1

You can modify how many chunks you want in your webpack configuration file (example is from a vue.config.js file) like this:

module.exports = {
  configureWebpack: {
    optimization: {
      splitChunks: {
        minSize: 10000,
        maxSize: 250000,
      }
    }
  },
};

I don't know your filesize, but if you increase maxSize as needed, you can have a single file.

Sign up to request clarification or add additional context in comments.

3 Comments

Added maxSize but still getting same result
It was affecting vendor related chunks, but those 1.js, 2.js, 3. js, they are still not getting affected by it.
You can also try LimitChunkCount plugin: webpack.js.org/plugins/limit-chunk-count-plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.