{"id":15356773,"url":"https://github.com/yeppha/closure-compiler-gulp","last_synced_at":"2026-01-28T01:32:34.036Z","repository":{"id":71189230,"uuid":"81132483","full_name":"YePpHa/closure-compiler-gulp","owner":"YePpHa","description":"Gulp addon for using Closure Compiler to create Chrome extensions","archived":false,"fork":false,"pushed_at":"2017-12-06T22:22:21.000Z","size":47,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T07:57:06.959Z","etag":null,"topics":["closure","closure-compiler","closure-library","compiler","extension","gulp"],"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/YePpHa.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-02-06T20:55:14.000Z","updated_at":"2023-09-08T17:20:33.000Z","dependencies_parsed_at":"2023-07-10T13:43:03.050Z","dependency_job_id":null,"html_url":"https://github.com/YePpHa/closure-compiler-gulp","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.4375,"last_synced_commit":"bcae12b1459f58fb05d107c0dbe3ee3c4d52c5ea"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YePpHa/closure-compiler-gulp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fclosure-compiler-gulp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fclosure-compiler-gulp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fclosure-compiler-gulp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fclosure-compiler-gulp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YePpHa","download_url":"https://codeload.github.com/YePpHa/closure-compiler-gulp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fclosure-compiler-gulp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["closure","closure-compiler","closure-library","compiler","extension","gulp"],"created_at":"2024-10-01T12:29:54.170Z","updated_at":"2026-01-28T01:32:34.023Z","avatar_url":"https://github.com/YePpHa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Closure Compiler Gulp\n[![Greenkeeper badge](https://badges.greenkeeper.io/YePpHa/closure-compiler-gulp.svg)](https://greenkeeper.io/)\n\nGulp addon for using Closure Compiler to i.e. create Chrome extensions.\n\n## How does it work\nInstead of inputting a namespace like in Google Closure Compiler a file is\nneeded instead. This file can take usage of the `${CMD}` tokens where it's\nreplaced by the output of the `CMD`. The `CMD` is using\n[minimist](https://github.com/substack/minimist) to get the executable and the\narguments for the command.\n\nAvailable executable commands:\n* config - Example: `${config \u003cPROPERTY IN CONFIG\u003e}`\n* calcdeps - Example: `${calcdeps -t json \u003cNAMESPACE\u003e}`\n* i18n - Example: `${i18n -t json -b}`\n\n## Commands\n### config\n**Name**\n`config - Outputs the value of the given property.`\n\n**Synopsis**\n`config [property]`\n\n**Description**\nOutputs the value of the given property.\n\nThe property is from the `config` property in the `Object` when initializing a\nnew instance of `new ClosureCompiler(\"closure\", Object)`. It uses dot notation\nto traverse the object.\n\n### calcdeps\n**Name**\n`calcdeps - Calculates the dependency of namespace and outputs the result.`\n\n**Synopsis**\n`calcdeps [-t|-c|-d] [namespace]`\n\n**Description**\nCalculates the dependency of namespace and outputs the result.\n\nThere are two modes it can calculate dependencies. It can either use Google\nClosure Compiler or a simple\n[calcdeps list](https://github.com/google/closure-library/blob/master/closure/bin/calcdeps.py).\n\nIn production it's recommended to use Google Closure Compiler. However, while\ndeveloping is ongoing it will be faster to use calcdeps to test changes.\n\nThe [defines](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#define-type-description)\ncan be set to an Object with key, value pairs where the key is name of the\ndefine and the value is the value of the define. It uses dot notation to\ntraverse the `Object`.\n\nTypes\n* `content`       A string with the content of all the files separated by `;`.\n* `html`          The file list is converted into HTML script tags where `src`\n                  refers to the file relative to the dist directory. It also\n                  includes the attribute `type` with the value\n                  `text/javascript`.\n* `json`          An encoded JSON array with the files relative to the dist\n                  directory or what `gulp.dest()` refers to.\n* `json-content`  An encoded JSON array with the files' content.\n* `json-string`   The first entry from `json`. It will output as a JSON encoded\n                  string.\n\nOptions\n* -t, --type      the type of the output.\n* -c, --compiler  the compiler to use. Either `closure` or `calcdeps`.\n* -d, --defines   The defines to include from `Object`.\n\n### i18n\n**Name**\n`i18n - Merges the i18n language directories into a single object.`\n\n**Synopsis**\n`i18n [-t|-b]`\n\n**Description**\nMerges the i18n language directories into a single object.\n\nIt can only output as an encoded JSON object.\n\nOptions\n* -t, --type      the type of the output (only json is available).\n* -b, --base      whether to only include language base configurations or the\n                  i18n object. The `base` only includes the `__base.json` file\n                  and without the `base` the `__base.json` is excluded.\n\n# Examples\n## Gulp\n```javascript\nvar gulp = require('gulp');\nvar ClosureCompiler = require('closure-compiler-gulp');\n\ngulp.task('compile-js', function() {\n  var cc = new ClosureCompiler(\"closure\", require(\"./config.production.json\"));\n\n  return gulp.src([\"src/manifest.json\"])\n    .pipe(cc.compile())\n    .pipe(gulp.dest(\"./dist\"));\n});\n```\n\n## manifest.json\n```json\n{\n  \"manifest_version\": 2,\n  \"name\": ${config name},\n  \"description\": ${config description},\n  \"version\": ${config version},\n  \"default_locale\": \"en\",\n  \"background\": {\n    \"scripts\": ${calcdeps --defines defines.general --type json my.awesome.app},\n    \"persistent\": true\n  },\n  \"permissions\": [\n    \"*://www.some-website.com/\"\n  ]\n}\n```\n\n## config.production.json\n```json\n{\n  \"config\": {\n    \"name\": \"My awesome app\",\n    \"description\": \"La la la.\",\n    \"version\": \"2.1.0\",\n    \"defines\": {\n      \"general\": {\n        \"awesome.enable\": true,\n        \"thirdparty.config.lalala\": false\n      }\n    }\n  },\n  \"compiler\": {\n    \"closure\": {\n      \"baseFile\": \"./node_modules/google-closure-library/third_party/closure/goog/base.js\"\n    },\n    \"calcdeps\": {\n      \"baseFile\": null\n    },\n    \"dependencies\": [\n      [\n        \"./node_modules/google-closure-library/closure/goog/**/*.js\",\n        \"!./node_modules/google-closure-library/closure/goog/**/*_test.js\"\n      ], [\n        \"./node_modules/google-closure-library/third_party/closure/goog/**/*.js\",\n        \"!./node_modules/google-closure-library/third_party/closure/goog/**/*_test.js\"\n      ], [\n        \"./src/js/**/*.js\",\n        \"!./src/js/**/*_test.js\"\n      ]\n    ]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeppha%2Fclosure-compiler-gulp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeppha%2Fclosure-compiler-gulp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeppha%2Fclosure-compiler-gulp/lists"}