vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.99k stars 914 forks source link

Very high memory consumption while building multiple vue apps #1986

Closed nils-christian closed 2 years ago

nils-christian commented 2 years ago

Hi,

We are using vue-loader (usually together with the html-webpack-plugin, but I omit this in the following because it is not the important part) to transpile multiple vue based applications within a single project. Our webpack configuration looks a little bit like the following:

const apps = [
  { html: 'app-1', js: 'app-1' },
  { html: 'app-2', js: 'app-2' },
  ...
]

module.exports = (_a, _b) =>({
  entry: Object.fromEntries(apps.map(app => [app.js, './src/${app.js}.js'])),
  ...
  plugins: [
    new VueLoaderPlugin()
  ],
  ...
})

So for instance, app-1.html has a div with id app, which is referenced in app-1.js:

import Vue from 'vue'
import App1 from './app-1.vue'
...
new Vue({...}).$mount('#app')

This means our directory structure (very simplified) looks like the following:

Now here is our problem: We noticed a very high memory consumption, which increases drastically the more apps we have in our apps array. This is something like > 10 GB for a project containing 8 of these apps.

Could this be something like a memory leak in the vue-loader or are we somehow misusing the plugin? We are using version 15.10.0 of vue-loader.

Thank you and best regards

Nils

PS: If necessary I can provide a complete example to show our issue.

vue-bot commented 2 years ago

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!