{"id":19885533,"url":"https://github.com/nafg/mill-bundler","last_synced_at":"2025-07-28T23:35:26.759Z","repository":{"id":63865663,"uuid":"569899457","full_name":"nafg/mill-bundler","owner":"nafg","description":"Javascript module resolution and bundling for the Mill build tool","archived":false,"fork":false,"pushed_at":"2025-06-12T10:37:58.000Z","size":79,"stargazers_count":8,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-12T10:38:29.924Z","etag":null,"topics":["mill","mill-plugin","npm","rollup","scala","webpack"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nafg.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-23T21:52:05.000Z","updated_at":"2025-06-12T10:38:01.000Z","dependencies_parsed_at":"2023-11-08T06:05:31.398Z","dependency_job_id":"c9ad57a1-7d23-4617-99b0-df045f0b99cf","html_url":"https://github.com/nafg/mill-bundler","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nafg/mill-bundler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafg%2Fmill-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafg%2Fmill-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafg%2Fmill-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafg%2Fmill-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nafg","download_url":"https://codeload.github.com/nafg/mill-bundler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nafg%2Fmill-bundler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267604442,"owners_count":24114534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mill","mill-plugin","npm","rollup","scala","webpack"],"created_at":"2024-11-12T17:34:31.774Z","updated_at":"2025-07-28T23:35:26.705Z","avatar_url":"https://github.com/nafg.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mill-bundler\n\nA Mill plugin for managing NPM dependencies for Scala.js code, and bundling the output.\n\n## Usage\n\n### Managing NPM dependencies\n\nTo manage NPM dependencies, mix `ScalaJSNpmModule` into your Mill module.\n\nIf you have a dependency on a published library that defines `scalajs-bundler`'s `npmDependencies`, or otherwise\ncontains an `NPM_DEPENDENCIES` manifest file in its jar, those NPM dependencies will be automatically added. You can\nalso override the `jsDeps` target.\n\nYou can see the result by running `mill frontend.allJsDeps`.\n\n```scala\nimport $ivy.`io.github.nafg.millbundler::jsdeps::0.1.0`, io.github.nafg.millbundler.jsdeps._\n\n\nobject frontend extends ScalaJSNpmModule {\n  override def scalaVersion = \"2.13.10\"\n  override def scalaJSVersion = \"1.12.0\"\n  override def jsDeps =\n    super.jsDeps() ++\n      JsDeps(\n        dependencies = Map(\n          \"react\" -\u003e \"17.0.2\",\n          \"react-dom\" -\u003e \"^17\"\n        ),\n        devDependencies = Map(\n          \"typescript\" -\u003e \"*\"\n        ),\n        jsSources = Map(\n          \"demo.js\" -\u003e \"console.log('hello world')\"\n        )\n      )\n}\n```\n\nThe trait provides an `npmInstall` target, which will run `npm install` in the directory specified by the `jsDepsDir`\ntarget, which defaults to the one allocated for it by Mill.\n\n### Bundling\n\nTo bundle your Scala.js code, mix in `ScalaJSRollupModule` or `ScalaJSWebpackModule` into your module. They extend\nScalaJSNpmModule, so everything from the previous section applies.\n\n```scala\nimport $ivy.`io.github.nafg.millbundler::millbundler::0.1.0`, io.github.nafg.millbundler._\n\n\nobject frontend extends ScalaJSRollupModule {\n  // ...\n}\n```\n\nYou can then run `mill frontend.devBundle` or `mill frontend.prodBundle` to bundle your Scala.js code into a single\nJavaScript file.\n\n### Testing\n\n`ScalaJSNpmModule`, `ScalaJSRollupModule`, `ScalaJSWebpackModule` provide a `Test` trait in their respective companion\nobjects. You can mix it into your test module to make sure your tests run after the NPM dependencies are installed, and\nafter the bundle is built.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnafg%2Fmill-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnafg%2Fmill-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnafg%2Fmill-bundler/lists"}