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
I couldn't find an explanation for this anywhere: Not in the docs, not on the web, anywhere.
For example, the official getting started guide uses Lodash as an example library to import. The guide imports the library using the ES6 module syntax.
However, as of now, Lodash uses CommonJS module system to export stuff. I cannot understand how can webpack import stuff using ES6 module syntax from a module written in CommonJS syntax.
Had we used Babel, I would say that Babel is first transpiling the ES6 module syntax to CommonJS module syntax and hence, webpack is easily using these two different module syntaxes together, thanks to Babel.
Is webpack doing the same thing behind the scenes? Or is it doing something else? In any case, where can I find further information on it?
The text was updated successfully, but these errors were encountered:
Please see my comment to your original question on #552.
Is webpack doing the same thing behind the scenes? Or is it doing something else? In any case, where can I find further information on it?
The short answer is yes, webpack supports multiple syntaxes out of the box. See that comment for links to the pages that discuss which ones are supported.
I couldn't find an explanation for this anywhere: Not in the docs, not on the web, anywhere.
For example, the official getting started guide uses Lodash as an example library to import. The guide imports the library using the ES6 module syntax.
However, as of now, Lodash uses CommonJS module system to export stuff. I cannot understand how can webpack import stuff using ES6 module syntax from a module written in CommonJS syntax.
Had we used Babel, I would say that Babel is first transpiling the ES6 module syntax to CommonJS module syntax and hence, webpack is easily using these two different module syntaxes together, thanks to Babel.
Is webpack doing the same thing behind the scenes? Or is it doing something else? In any case, where can I find further information on it?
The text was updated successfully, but these errors were encountered: