How to switch webpack between package.json alternatives to main attribute: unpkg, main:src, source, jsnext:main, main:umd, jsdelivr when building bundle (to set up get source from them) ?
I know that some loaders prefer e.g. 'module' if it exists but I expect there should be also "manual" directive in webpack config: prefer another attribute for concreate dependency.
I have tried to guess is it possible with aliases syntax, but this doesn't work:
resolve: {
alias: {
"@popperjs/core": "main:umd"
},
},
Is there the standard way to open the 'package.json' of dependecy by its name? Then I would be able to parse it and put the path I need as alias.