Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
What are differences between { default as name } and { name as default } when exporting js modules?

I was taking a look to the swiper.esm.js from Swiperjs (source copied here for reference: https://jsfiddle.net/fw4zj8qk/), and the first line is

export { default as Swiper, default } from './core/core.js';

while the following are of the form:

export { default as Virtual } from './modules/virtual/virtual.js';

and in MDN docs i can find that also something like

export { Something as default }

is possible. So I can currently see the following syntaxes:

export { Something as default }
export { default as Something }
export { default as Something, default }

What are the difference between the 3?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

// Import name `Something` from `...`, 
//   re-export as this module's default export
export { Something as default } from '...';

// Import default export from `...`, 
//   re-export as `Something` from this module
export { default as Something } from '...';

// Import default export from `...`, 
//   re-export it as `Something` from this module 
//   and this module's default export
export { default as Something, default } from '...';
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!