{"id":20565822,"url":"https://github.com/spudmashmedia/esm-rollup-combo","last_synced_at":"2026-04-29T08:34:56.539Z","repository":{"id":42358018,"uuid":"162432726","full_name":"spudmashmedia/esm-rollup-combo","owner":"spudmashmedia","description":"NO BABEL!!! NO WEBPACK!!! Just ESM.js + Rollup.js FTW!!! ლ(ಠ益ಠ)ლ ","archived":false,"fork":false,"pushed_at":"2022-12-08T08:44:40.000Z","size":351,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-31T21:39:15.913Z","etag":null,"topics":["axios","bunyan","chai","es6","esm","esmodules","javascript","mocha","moxios","nodejs","rollup","rollup-js","rollupjs","sinon","sinonjs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spudmashmedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-19T12:12:56.000Z","updated_at":"2023-03-05T04:24:17.000Z","dependencies_parsed_at":"2023-01-25T09:45:06.780Z","dependency_job_id":null,"html_url":"https://github.com/spudmashmedia/esm-rollup-combo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spudmashmedia/esm-rollup-combo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fesm-rollup-combo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fesm-rollup-combo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fesm-rollup-combo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fesm-rollup-combo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spudmashmedia","download_url":"https://codeload.github.com/spudmashmedia/esm-rollup-combo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spudmashmedia%2Fesm-rollup-combo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32418030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axios","bunyan","chai","es6","esm","esmodules","javascript","mocha","moxios","nodejs","rollup","rollup-js","rollupjs","sinon","sinonjs"],"created_at":"2024-11-16T04:39:13.910Z","updated_at":"2026-04-29T08:34:56.524Z","avatar_url":"https://github.com/spudmashmedia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esm-rollup-combo 🙌🗞\n\nJust ESM.js + Rollup.js FTW!!! 🙌 ლ(ಠ益ಠ)ლ \n\n# Summary\nThis NodeJS repository demonstrates the usage of **ONLY**:\n- 🙌 [ESM (ES Module Loader alternative to 'node --experimental-modules')](https://github.com/standard-things/esm)\n- 🗞 [RollupJS (a damn better bundler than Webpack!!!!)](https://rollupjs.org)\n\nAnd you definitely **DON'T NEED** the following for pure NodeJS apps:\n- ❌ BABEL!!! 😑👎\n- ❌ WEBPACK!!! 😑👎\n\n\n# Background\nSo at the time of writing this (19 Dec 2018) NodeJS LTS was v10.14.2 which means ECMAScript 6 **should** just work right out of the box (we're talking 'import' and all ES6 goodness). So why the hell is it so difficult to get running? ლ(ಠ益ಠ)ლ \n\n## 🤔 What about 'node --experimental-modules *.mjs'?\nThis works, except at the time of trying there was issues using [Jestjs Testing](https://jestjs.io/) which didn't acknowledge the *.mjs file extension and the hacks were horrendous which lead to a hunt for a sensible toolchain.\nSo ended up reverting to a combination of:\n- [Mocha](https://mochajs.org/)\n- [Chai (using Expect)](https://www.chaijs.com/)\n- [Sinon test spies](https://sinonjs.org/)\n- [Moxios - Axios Mocks](https://github.com/axios/moxios)\n\n**!!!Yes this rant is all about getting testing to work!!!**\n\n**!!!❌NO TESTS - ❌NO STRAIGHT TO PRODUCTION #s2p!!!**\n\n## 🤔 What happened to Babel \u0026 Webpack?\n\nDefinitely both useful tools for bundling frontend code and would spend the extra time to get it running (but DAMN are those tools FIDDLY!).\nEven after removing Jest \u0026 setting up Webpack 4 for bundling, there were issues with resultant app.bundle.js acknowledging the NODE_ENV with this project ('mode':'production' was set etc...), so not a smooth development experience.\n\nHowever, for pure backend NodeJS apps with no frontend, those tools are not necessary when writing code in ES6. Instead we're going with the bare minimum, [ESM](https://github.com/standard-things/esm) \u0026 [Rollup to bundle up our app](https://rollupjs.org)\n\n### ⚙️ Development Strategy - use ESM\n[ESM](https://github.com/standard-things/esm)\n```\nnpm install --save esm\n```\n\npackage.json\n```\n  \"scripts\": {\n    \"develop\": \"node -r esm src/index.js\",\n```\n\n### ⚙️ Production Strategy - use RollupJS to bundle\n[RollupJS (a damn better bundler than Webpack!!!!)](https://rollupjs.org)\n```\nnpm install --save-dev rollup rollup-plugin-node-resolve\n```\n\npackage.json\n```\n\"scripts\": {\n    \"build\": \"rollup --config rollup.config.prod.js\"\n```\n\nrollup.config.production.js\n```\nimport resolve from \"rollup-plugin-node-resolve\";\n\nexport default {\n    input: './src/index.js',\n    output: [\n        {\n            file: './dist/app.bundle.js',\n            format: 'cjs',\n            sourceMap: true\n        }\n    ],\n    plugins: [\n        resolve({\n            module: true,\n            modulesOnly: true\n        })\n    ]\n}\n```\n\n## 🤔 Could you use Rollup Develop builds instead of ESM?\nMost definitely, just create a rollup.config.dev.js and have a filewatcher for continuous develop builds.\nI like ESM, it's quick and it works well 🙌\n\n# ⚙️ NPM Commands\n### Install node_modules\n```\nnpm install\n```\n### Tests\n```\nnpm test\n```\n### Build\n```\nnpm run build\n```\n### Start\n```\nnpm start\n```\n\n# License\nMIT\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspudmashmedia%2Fesm-rollup-combo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspudmashmedia%2Fesm-rollup-combo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspudmashmedia%2Fesm-rollup-combo/lists"}