You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several tools we use in our front-end toolchain (e.g. del, gulp-imagemin) have abandoned CommonJS (CJS) in favor of ECMAScript Modules (ESM). Our tooling uses CJS (as that has been the standard for Node.js projects since time immemorial), which cannot import ESM modules.
We should take steps to upgrade our tooling so that it can support both ESM and CJS, so that we are free to use whatever packages best solve our problems without worrying about whether the module-loading system is supported.
Stay on the dual-loading versions of modules that have moved on to ESM-only.
This is not a good idea, as we would stop receiving patches and new feature updates.
Replace ESM-only modules with similar packages that support CJS.
This may work, but it means that we are limiting the pool of packages available to our devs to only those that support CJS. It also means that every time a package is updated to only support ESM, work is created for our team to find a CJS-compatible equivalent, one which may or may not exist.
Additional Context
The text was updated successfully, but these errors were encountered:
Some initial explorations reveal a complication with the way that we dynamically export tasks from config. Namely, that ESM does not seem to support dynamic exports, so this clever trick we pull to automatically export custom tasks defined downstream so that Gulp can pick them up will need to be refactored in some way.
Description
Several tools we use in our front-end toolchain (e.g.
del
,gulp-imagemin
) have abandoned CommonJS (CJS) in favor of ECMAScript Modules (ESM). Our tooling uses CJS (as that has been the standard for Node.js projects since time immemorial), which cannot import ESM modules.We should take steps to upgrade our tooling so that it can support both ESM and CJS, so that we are free to use whatever packages best solve our problems without worrying about whether the module-loading system is supported.
Issue Owner
Acceptance Criteria
Proposed Solution
Follow this Gulp-centric guide to support ESM.
Alternatives Considered
This is not a good idea, as we would stop receiving patches and new feature updates.
This may work, but it means that we are limiting the pool of packages available to our devs to only those that support CJS. It also means that every time a package is updated to only support ESM, work is created for our team to find a CJS-compatible equivalent, one which may or may not exist.
Additional Context
The text was updated successfully, but these errors were encountered: