What's the difference between js,export multiple functions and export hanging multiple functions on one object?

//tool.js
export const a = () =>()
export const b = () =>()
//tool.js
export default {
    a:()=>()
    b:
    c:
    ...
}

what"s the difference between these two when webpack compiles? When loading on demand
which do you use when writing utility functions?

what I want to ask is whether
webpack packaging on demand will separate the functions in the first one. For example, if I have a file import {a}
webpack, just take out the a function. If you use the object, it must be the whole file

.
Jun.22,2022

Don't you think you can still use a function in the b function (funny)


does the landlord have the answer? Is it all right to introduce on demand?

Menu