I think a code example should have existed here but it seems deleted at some time.
Now let’s do something similar for
assets/js/main.js, and add the following to it:
npm run production, and it should result in a (slightly) larger main.js than before as well.
Someone please, check the history of this page