How to resize the parent task as per the child?

I am using basic initialization, how could I resize the parent task based on the size of all child tasks.

For example: if the child size increased even further to parent one, then parent task size should also be increased, however, if the child size is decreased, then the parent should not be decreased automatically.

Any help guys? Let me know if you need anything from my side?

Unfortunately, there is no such built-in solution.
But you can do it manually.
You can change the start_date/end_date of the parent task during the onAfterTaskDrag event. You may also need to round the date of the parent task, this can be done using roundDate.
It might look something like this:

gantt.attachEvent("onAfterTaskDrag", (id, mode, e) => {
    if (gantt.getParent(id) != 0) {
        const parent = gantt.getTask(gantt.getParent(id));
        const task = gantt.getTask(id);

        if (+parent.start_date > +task.start_date) {
            parent.start_date = gantt.roundDate(task.start_date);

        if (+parent.end_date < +task.end_date) {
            parent.end_date = gantt.roundDate(task.end_date)

Please see an example: