{"id":15016610,"url":"https://github.com/gregives/eleventy-load-js","last_synced_at":"2026-01-04T22:43:50.674Z","repository":{"id":49412146,"uuid":"314059344","full_name":"gregives/eleventy-load-js","owner":"gregives","description":"Bundle and minify JavaScript with webpack using eleventy-load","archived":false,"fork":false,"pushed_at":"2021-06-29T20:32:33.000Z","size":171,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T10:57:43.919Z","etag":null,"topics":["eleventy","eleventy-load","webpack"],"latest_commit_sha":null,"homepage":"","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/gregives.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-18T21:12:24.000Z","updated_at":"2022-02-20T12:34:33.000Z","dependencies_parsed_at":"2022-09-16T23:52:37.613Z","dependency_job_id":null,"html_url":"https://github.com/gregives/eleventy-load-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregives%2Feleventy-load-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregives%2Feleventy-load-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregives%2Feleventy-load-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregives%2Feleventy-load-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregives","download_url":"https://codeload.github.com/gregives/eleventy-load-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244990069,"owners_count":20543614,"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","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":["eleventy","eleventy-load","webpack"],"created_at":"2024-09-24T19:49:08.448Z","updated_at":"2026-01-04T22:43:50.646Z","avatar_url":"https://github.com/gregives.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eleventy-load-js\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n[![Prettier][prettier-src]][prettier-href]\n\nBundle and minify JavaScript with webpack using [eleventy-load](https://github.com/gregives/eleventy-load).\n\n## Getting Started\n\nFirstly, you'll need to install [eleventy-load](https://github.com/gregives/eleventy-load) (if you haven't already) and eleventy-load-js. You'll probably want to use eleventy-load-js in combination with [eleventy-load-html](https://github.com/gregives/eleventy-load-html) and [eleventy-load-file](https://github.com/gregives/eleventy-load-file), so we'll install those as well. The latter writes the output of eleventy-load-js to a file which will be saved in Eleventy's output directory, which is the behavior you often want for JavaScript.\n\n```sh\nnpm install --save-dev eleventy-load eleventy-load-js eleventy-load-html eleventy-load-file\n```\n\nThen you can set up eleventy-load-js using a rule in your eleventy-load options.\n\n```js\nmodule.exports = function (eleventyConfig) {\n  eleventyConfig.addPlugin(require(\"eleventy-load\"), {\n    rules: [\n      {\n        test: /\\.html$/,\n        loaders: [\n          {\n            loader: require(\"eleventy-load-html\"),\n          },\n        ],\n      },\n      {\n        test: /\\.js$/,\n        loaders: [\n          {\n            loader: require(\"eleventy-load-js\"),\n            options: {\n              mode: \"production\",\n            },\n          },\n          {\n            loader: require(\"eleventy-load-file\"),\n          },\n        ],\n      },\n    ],\n  });\n};\n```\n\n## Options\n\n| Name                   | Type     | Default   | Description         |\n| ---------------------- | -------- | --------- | ------------------- |\n| [**`webpack`**](#name) | `Object` | See below | Options for webpack |\n\n### `webpack`\n\nType: `Object`\n\nPass options to the webpack configuration. By default, eleventy-load-js is configured to use the project's input directory as the webpack context and uses an in-memory file system for webpack's output.\n\n```js\n{\n  context: path.resolve(this.config.inputDir),\n  entry: [path.resolve(this.config.inputDir, this.resourcePath)],\n  mode: \"production\",\n}\n```\n\n\u003c!-- References --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/eleventy-load-js/latest.svg\n[npm-version-href]: https://npmjs.com/package/eleventy-load-js\n[npm-downloads-src]: https://img.shields.io/npm/dt/eleventy-load-js.svg\n[npm-downloads-href]: https://npmjs.com/package/eleventy-load-js\n[license-src]: https://img.shields.io/npm/l/eleventy-load-js.svg\n[license-href]: https://npmjs.com/package/eleventy-load-js\n[prettier-src]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg\n[prettier-href]: https://github.com/prettier/prettier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregives%2Feleventy-load-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregives%2Feleventy-load-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregives%2Feleventy-load-js/lists"}