{"id":13782475,"url":"https://github.com/fathyb/parcel-plugin-closure","last_synced_at":"2025-04-11T05:21:27.432Z","repository":{"id":75403533,"uuid":"115314969","full_name":"fathyb/parcel-plugin-closure","owner":"fathyb","description":"Closure Compiler integration for Parcel, with modules support","archived":false,"fork":false,"pushed_at":"2018-01-08T20:30:54.000Z","size":114,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T02:06:03.212Z","etag":null,"topics":["closure-compiler","minify","parcel","tree-shaking"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/fathyb.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}},"created_at":"2017-12-25T07:04:24.000Z","updated_at":"2023-04-21T07:43:18.000Z","dependencies_parsed_at":"2023-06-06T09:45:46.768Z","dependency_job_id":null,"html_url":"https://github.com/fathyb/parcel-plugin-closure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fparcel-plugin-closure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fparcel-plugin-closure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fparcel-plugin-closure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fathyb%2Fparcel-plugin-closure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fathyb","download_url":"https://codeload.github.com/fathyb/parcel-plugin-closure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248346253,"owners_count":21088424,"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":["closure-compiler","minify","parcel","tree-shaking"],"created_at":"2024-08-03T18:01:37.703Z","updated_at":"2025-04-11T05:21:27.408Z","avatar_url":"https://github.com/fathyb.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Other"],"readme":"# parcel-plugin-closure\n\nClosure compiler based packager for Parcel\n\n## Prerequisites\n\n- Java's JDK 8 (*not the JRE*), and the `JAVA_HOME` environment variable defined\n- `google-closure-compiler` and `parcel-bundler` installed locally\n\n`closure-compiler-js` is not supported because it does not support modules (used for Parcel code-splitting).\n\n## Usage\n\nYou just need to add `parcel-plugin-closure` to your `devDependencies` :\n\n`yarn add parcel-plugin-closure --dev`\n\nor\n\n`npm install parcel-plugin-closure --save-dev`\n\n## Configuration\n\nYou can pass an optional configuration in a `.parcelclosurerc` file in the root of your project.\n\n```js\n{\n\t// a list of externs files to pass to Closure\n\t\"externs\": [\"src/my-externs\"],\n\t\"bundles\": {\n\t\t// You can configure a bundle by referencing it's entry point\n\t\t\"src/dynamically-imported-file\": {\n\t\t\t// the closure optimization level, \"simple\" or \"advanced\" defaults to advanced\n\t\t\t\"optimization\": \"advanced\",\n\t\t\t// The list of the values exported, this is only needed for dynamically\n\t\t\t// imported modules\n\t\t\t\"exports\": [\"AnExportedValue\"]\n\t\t}\n\t}\n}\n```\n\n## Angular support\n\nThe plugin supports lazy-loading with `loadChildren`, you'll need to specify your factories exports.\nIt already includes the basic `externs` needed if Angular is detected.\n\n\n```js\n{\n\t\"bundles\": {\n\t\t\"src/shared/components/lazy.module.ngfactory\": {\n\t\t\t\"exports\": [\"LazyModuleNgFactory\"]\n\t\t}\n\t}\n}\n```\n\n## Development\n\nThis plugin is divided in two part :\n- A simple Closure wrapper running in a Java virtual-machine, we need it mainly for the virtual file-system (we give it files as processed by Parcel, not from from the disk)\n- The Parcel plugin, it contains a Parcel packager and a JavaScript asset. It calls the Closure wrapper using `node-java`.\n\n### Java part (Kotlin)\n\nYou need the Java JDK 8 and Gradle 2.4+ installed.\n\n- Download the Gradle wrapper : `gradle wrapper --gradle-version 4.4.1`\n- Build the jar in `build/kotlin/libs` : `./gradlew build`\n\n### JavaScript part (TypeScript)\n\nYou need Node.js 8+ and Yarn installed.\nYou can use `npm` instead of `yarn` but it will make your setup non-reproductible.\n\n- Fetch the dependencies: `yarn` or `npm install`\n- Build the JavaScript files in `build/javascript` : `yarn build:ts` or `npm run build:ts`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffathyb%2Fparcel-plugin-closure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffathyb%2Fparcel-plugin-closure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffathyb%2Fparcel-plugin-closure/lists"}