require('dropzone/dist/dropzone.css'); const { Dropzone } = require("dropzone"); document.addEventListener('DOMContentLoaded', function() { var elt = document.getElementById('mydropzone'); maxFiles=elt.getAttribute("data-maxFiles"); if(maxFiles!=1) maxFiles=null; var mydropzone = new Dropzone(elt, { acceptedMimeTypes: $(elt).data("acceptedMimeTypes"), maxFiles: maxFiles, init: function() { dropzoneinit(this); }, success: function( file, response ){ dropzonesuccess(file,response); }, queuecomplete: function (file) { dropzonequeuecomplete(file); } }); window.mydropzone=mydropzone; });