I spent my day searching for a solution but I didn't mange to solve this, first am new to webpack and not much advanced with js I managed after a long day to export my 2 simple functions :
script.js
function scrollright(el) {
...
}
function scrollleft(el) {
...
}
export {
scrollright,
scrollleft,
}
and import them in index.js
import { scrollleft, scrollright } from './script';
scrollleft();
scrollright();
building finishes successfully but the problem is that those function take parameters and those parameters are passed to js (previously before webpack) through html onclick tag like this :
onclick="scrollleft(this)"
I didn't figure out how I can transfer this completely to webpack maybe it's a newbie question but I can't find anything that helps me or at least if this is not possible a simple clarification or a proposed solution would be appreciated.