lundi 9 septembre 2019

Using quill modules with vue2-editor and webpack mix

I'm currently using vue2-editor and importing quill modules and registering them as per documentation.But getting error window.Quill is undefined.

I've tried webpack plugin mix to include window.Quill and Quill but still error remains the same.

In my vue component

import { VueEditor } from "vue2-editor";
import { Quill } from "quill";
import { ImageDrop } from "quill-image-drop-module";
import { ImageResize } from "quill-image-resize-module";
Quill.register("modules/imageDrop", ImageDrop);
Quill.register("modules/imageResize", ImageResize);

And in my webpack mix

mix.extend('foo',new class{
    webpackPlugins(){
        return new webpack.ProvidePlugin({
            "window.Quill": "quill/dist/quill.js",
            Quill: "quill/dist/quill.js"
    });
    }
});  

Uncaught TypeError: Cannot read property 'imports' of undefined

which is from window.Quill.imports



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire