Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Include 'module' in webpack mainFields #591

Closed
austin20XX opened this issue Mar 1, 2021 · 2 comments
Closed

Include 'module' in webpack mainFields #591

austin20XX opened this issue Mar 1, 2021 · 2 comments

Comments

@austin20XX
Copy link

austin20XX commented Mar 1, 2021

Feature Request

Description

Similarly to how 'browser' was recently added to the resolve.mainFields, I would like to request 'module' be added in between so that the order is ['browser','module','main'].

Additional Context / Screenshots

My team is experiencing a breaking issue in IE11 when importing the uuid package versions 8.3.0 or greater, as we see the syntax error Expected ')'. Based on the additional context section of this feature request, it looks the 'browser' mainField was added for similar compatibility concerns.

Here are some threads with information regarding the issue and where I pulled the suggested solution from:
uuidjs/uuid#516
uuidjs/uuid#551

I modified my local terra webpack config to have the order ['browser','module','main'] and can confirm it did resolve the issue

@ Mentions

@ryanthemanuel
Copy link
Contributor

Hi @AustinMack. We ran into problems with 'module' in the list of mainFields as a lot of projects have es6 code in those modules and they thus aren't babeled like they need to be for the browsers that we support. This is something you guys could override if you don't have that requirement.

@StephenEsser
Copy link
Contributor

Related specifically to the uuid dependency; our projects are currently using version ^3.4.0 due to later versions of uuid dropping support for IE10. This version of uuid sounds really out of date, but if you look at the releases and tags it's only a handful of release behind and includes the majority of the uuid strategies:

https://github.com/uuidjs/uuid/tags
https://github.com/uuidjs/uuid/releases

If your project needs to support IE10 you may also need to drop down to ^3.4.0, but if not the webpack change or solutions posted on those threads might be better suited

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants