Closed qxygene closed 2 years ago
const Cropper = () => import(/webpackChunkName: "cropper"/ "vue-advanced-cropper").then( (module) => { console.log(module); return module.Cropper; } );
now it works. it saved me 82kb while build.
@qxygene, hello!
It's the normal behavior. The explanation is pretty simple:
import
dynamically load a module, not one of named exports. Therefore to get the named export Cropper
you need to process the promise result:
const Cropper = () =>
import(/*webpackChunkName: "cropper"*/ "vue-advanced-cropper").then(module => module.Cropper)
async component
. The function that returns Promise whose value is the component options. So you can just pass it to the components list:
{
/* ... */
components: {
Cropper
}
}
@qxygene, is your issue still actual?
yes it is
@qxygene. what's wrong? The example above should work.
@qxygene, any news?
version 1.10.1 fixed the issue. thank you.
@qxygene, frankly, I don't get how it could solve your issue, but all is well that ends well.
I close issue then.
const Cropper = () => import(/webpackChunkName: "cropper"/ "vue-advanced-cropper");
It seems not working.