Parcel: Is there a similar webpack require.context function?

Created on 13 Aug 2018  路  2Comments  路  Source: parcel-bundler/parcel

No webpack's require.context function is very bad

Waiting Question

All 2 comments

Parcel tries to promote standardized and cross-tooling syntax, therefore it doesn't support any webpack specific things.

Besides that, the webpack specific things are just weird and not that usefull in most cases. (as there usually is a standardized similar approach that looks and works better...)

I've personally never used require.context, but it seems to me like a webpackified glob require.

See this for docs: https://github.com/isaacs/node-glob#glob-primer

Parcel's resolver natively supports globs...

It's also supported across several tools, not just Parcel or Webpack.

When using webpack specific or parcel specific things you just block yourself from ever upgrading to a better/newer tool.

import images from './*.jpg'

Was this page helpful?
0 / 5 - 0 ratings