Heya, wondering how we can take advantage of the rollup'd minified version in our webpack config.
Would it just be an alias in production or is there a way to get webpack to look for any module with that attribute in the package.json?
You can use resolve.mainFields so webpack will look for the main fields you specify. e.g.
resolve: {
mainFields: ['minified:main', ...otherMainFields]
}
awesome, that's what i was looking for – thanks!
FWIW I think once #675 or #674 are merged, the ESM bundle can actually get minified via uglify too so this will become unnecessary (I hope!).
Most helpful comment
You can use
resolve.mainFieldsso webpack will look for the main fields you specify. e.g.