Is there a bug when extracting Vue with the "extract" method in laravel-mix webpack

290 Views Asked by At

I followed the laravel-mix documentation to reduce the size of my vue application by using the extract(['vue]) method, it works well, however when i try using async components it won't work properly.

i already added babel to enable the promise syntax

mix.js('resources/js/app.js', 'public/js').version().extract(['vue'])

{
  "presets": ["@babel/preset-env"],
  "plugins": ["@babel/plugin-syntax-dynamic-import"]
}

i'm hoping there is something i am missing here and its not a actual bug that i will have to wait for a patch, has anyone seen this issue before?

1

There are 1 best solutions below

0
On

I just red this:

Warning: you can’t currently combine mix.extract() and async components. According to Laravel Mix this will be fixed when Webpack 5 gets released.

source: https://medium.com/maatwebsite/reducing-vue-application-file-size-with-laravel-mix-e483f746d836