bugsysha's avatar

Dynamic component loading causes Laravel Mix to loop

Since I do not know what template names will be added in the future I'm loading requested component like this

let template = require(`./${this.templateName}/index.vue`)

But that causes Laravel Mix in watch mode to compile over and over again

WAIT Compiling...

10% building modules 0/1 modules 1 active .../user/project /^\.\/.*\/index$/

So it drains my battery like I'm running benchmarks.

Any ideas how to solve this or what other approach to try?

Thanks in advance.

0 likes
1 reply

Please or to participate in this conversation.