Preact: Taking advantage of minified:main?

Created on 20 Jun 2017  Â·  3Comments  Â·  Source: preactjs/preact

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?

Most helpful comment

You can use resolve.mainFields so webpack will look for the main fields you specify. e.g.

resolve: {
  mainFields: ['minified:main', ...otherMainFields]
}

All 3 comments

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!).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matuscongrady picture matuscongrady  Â·  3Comments

paulkatich picture paulkatich  Â·  3Comments

noise-machines picture noise-machines  Â·  3Comments

KnisterPeter picture KnisterPeter  Â·  3Comments

mizchi picture mizchi  Â·  3Comments