<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/b5bNs2I50" -->

---
title: Bundling with Rollup | daily.dev
description: Rollup supports ES modules out of the box. To support CommonJS, the following plugins are required. To generate a UMD bundle with MyModuleName as the export...
canonical: https://daily.dev/posts/bundling-with-rollup-b5bns2i50
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Bundling with Rollup | daily.dev
og:description: Rollup supports ES modules out of the box. To support CommonJS, the following plugins are required. To generate a UMD bundle with MyModuleName as the export...
og:url: https://daily.dev/posts/bundling-with-rollup-b5bns2i50
og:image: https://api.daily.dev/og/posts/b5bNs2I50.png
og:image:alt: Bundling with Rollup
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bundling with Rollup

**[JSK](https://daily.dev/sources/jsk)** · 2 min read · 15 upvotes · 0 comments

## Summary

Rollup supports ES modules out of the box. To support CommonJS, the following plugins are required. To generate a UMD bundle with MyModuleName as the export name, use umd. To minify your bundle with rollup v2, use terser.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/javascript-in-plain-english/rollup-commonjs-umd-c6d019cfead>

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#nodejs](https://daily.dev/tags/nodejs)

[View this post on daily.dev](https://daily.dev/posts/bundling-with-rollup-b5bns2i50)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Bundling with Rollup","url":"https://daily.dev/posts/bundling-with-rollup-b5bns2i50","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/bundling-with-rollup-b5bns2i50"},"datePublished":"2020-11-05T13:35:30.301Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Rollup supports ES modules out of the box. To support CommonJS, the following plugins are required. To generate a UMD bundle with MyModuleName as the export...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bdecabe3e2581b8b3bdf858fa57ad56e","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bdecabe3e2581b8b3bdf858fa57ad56e","isAccessibleForFree":true,"articleSection":"JSK","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"JSK","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/jsk","url":"https://daily.dev/sources/jsk"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/bundling-with-rollup-b5bns2i50","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":15},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,nodejs","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JSK","item":"https://daily.dev/sources/jsk"},{"@type":"ListItem","position":3,"name":"Bundling with Rollup"}]}
```

