im currently trying to implement FilePond in my Project. I've tried to implement it through npm installation, but somehow my Browser constantly throws this error:
Uncaught SyntaxError: Unexpected token *
I'm guessing it has something to with ES6, but I can't figure out how to fix it. My Javascript code looks like this:
import * as FilePond from 'filepond';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview';
FilePond.registerPlugin(
FilePondPluginImagePreview()
);
const inputElement = document.querySelector('input[type="file"]');
const pond = FilePond.create( inputElement,{
allowImagePreview: true,
});
FilePond.setOptions({
server: 'test/'
});
I've tried to google an answer to this but it seems like I can't find a solution to this one. I've red something about compiling the ES6 code with Bable, but don't really know..
Thank you for your help! :)
import
in modules. From a browser, you have to includetype=module
in the<script>
tag.Uncaught TypeError: Cannot set property 'FilePond' of undefined
node_modules
without a bundler like webpack.