{"id":13733572,"url":"https://github.com/eriwen/gradle-js-plugin","last_synced_at":"2025-12-30T18:39:35.306Z","repository":{"id":50455576,"uuid":"2515985","full_name":"eriwen/gradle-js-plugin","owner":"eriwen","description":"Gradle plugin for working with JS","archived":true,"fork":false,"pushed_at":"2022-07-16T18:32:40.000Z","size":4366,"stargazers_count":382,"open_issues_count":71,"forks_count":113,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-15T02:34:22.492Z","etag":null,"topics":["gradle-plugin","javascript"],"latest_commit_sha":null,"homepage":"http://eriwen.github.io/gradle-js-plugin","language":"JavaScript","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/eriwen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-05T01:04:26.000Z","updated_at":"2024-09-12T08:02:25.000Z","dependencies_parsed_at":"2022-09-26T21:40:35.145Z","dependency_job_id":null,"html_url":"https://github.com/eriwen/gradle-js-plugin","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriwen%2Fgradle-js-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriwen%2Fgradle-js-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriwen%2Fgradle-js-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriwen%2Fgradle-js-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eriwen","download_url":"https://codeload.github.com/eriwen/gradle-js-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253036716,"owners_count":21844268,"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":["gradle-plugin","javascript"],"created_at":"2024-08-03T03:00:45.592Z","updated_at":"2025-12-15T16:42:46.647Z","avatar_url":"https://github.com/eriwen.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Web application development"],"readme":"# This plugin is no longer maintained! Please consider the [Gradle Node Plugin](https://github.com/node-gradle/gradle-node-plugin).\n\n# Gradle Javascript Plugin!\nAiming to be the *simplest* way to manage your JavaScript in a build.\n\n# Quick Start\nWrangling your JS in a [Gradle](https://gradle.org) build is easy! Just add this to your *build.gradle* file:\n\n### Gradle 2.1+\n```groovy\nplugins {\n  id \"com.eriwen.gradle.js\" version \"2.14.1\"\n}\n```\n\n### Gradle 2.0-\n```groovy\nbuildscript {\n  repositories {\n    jcenter()\n  }\n  dependencies {\n    classpath \"com.eriwen:gradle-js-plugin:1.12.1\"\n  }\n}\n\napply plugin: \"com.eriwen.gradle.js\"\n```\n\n\n```groovy\n// Declare your sources\njavascript.source {\n    dev {\n        js {\n            srcDir jsSrcDir\n            include \"*.js\"\n            exclude \"*.min.js\"\n        }\n    }\n    prod {\n        js {\n            srcDir jsSrcDir\n            include \"*.min.js\"\n        }\n    }\n}\n```\n\n### Combining Files ([options](#combinejs))\n```groovy\n// Configure the built-in task\ncombineJs {\n    encoding = \"UTF-8\"\n    source = javascript.source.dev.js.files\n    dest = file(\"${buildDir}/all.js\")\n}\n\n// Create new CombineJsTasks if you have multiple sets of JS files\ntask jsDev(type: com.eriwen.gradle.js.tasks.CombineJsTask) {\n    source = [\"${projectDir}/js/file1.js\", \"${projectDir}/js/file2.js\"]\n    dest = file(\"${buildDir}/all-debug.js\")\n}\n\ntask jsProd(type: com.eriwen.gradle.js.tasks.CombineJsTask) {\n    source = [\"${projectDir}/js/file1.js\", \"${projectDir}/js/file2.js\"]\n    dest = file(\"${buildDir}/all.js\")\n}\n```\n\n### Minifying files with [Google Closure Compiler](https://github.com/google/closure-compiler) ([options](#minifyjs-uses-the-google-closure-compiler))\n```groovy\nminifyJs {\n    source = combineJs\n    dest = file(\"${buildDir}/all-min.js\")\n    sourceMap = file(\"${buildDir}/all.sourcemap.json\")\n    closure {\n        warningLevel = 'QUIET'\n    }\n}\n```\n\n### GZip JS ([options](#gzipjs))\n```groovy\ngzipJs {\n    source = minifyjs\n    dest = file(\"${buildDir}/all-min.js\")\n}\n```\n\n### [JSHint](http://jshint.com) support ([options](#jshint))\n```groovy\njshint {\n    source = javascript.source.dev.js.files\n    dest = file(\"${buildDir}/jshint.out\")\n    reporter = 'checkstyle'\n    jshint.options = [expr: \"true\", unused: \"true\"]\n}\n```\n\n### [JSDoc 3](https://github.com/jsdoc3/jsdoc) support ([options](#jsdoc))\n```groovy\njsdoc {\n    source = [\"${projectDir}/js/file1.js\", \"${projectDir}/js/file2.js\"]\n    destinationDir = file(\"${buildDir}/jsdoc\")\n}\n```\n\n### [props2js](https://github.com/nzakas/props2js) support ([options](#props2js))\n```groovy\nprops2js {\n    source = file(\"${projectDir}/src/test/resources/test.properties\")\n    dest = file(\"${buildDir}/props.jsonp\")\n    props {\n        type = 'jsonp'\n        functionName = 'fn'\n    }\n}\n```\n\n### [require.js](http://requirejs.org/) via r.js ([options](#requirejs))\n```groovy\nrequireJs {\n    source = javascript.source.dev.js.files\n    dest = file(\"${buildDir}/out.js\")\n    requirejs.buildprofile = new File(\"src/main/resources/requirejs-config.js\")\n}\n```\n\n# Built-in Tasks and Options\n### combineJs\n- source = Collection of file paths of files to merge\n- dest = File for combined output\n\n### minifyJs (Uses the [Google Closure Compiler](https://github.com/google/closure-compiler))\n- source = File to minify\n- dest = File for minified output\n- *(Optional)* sourcemap = Source map file\n- *(Optional)* closure.compilationLevel = 'WHITESPACE_ONLY', 'SIMPLE_OPTIMIZATIONS' (default), or 'ADVANCED_OPTIMIZATIONS' (are you *hardcore*?)\n- *(Optional)* closure.warningLevel = 'QUIET', 'DEFAULT' (default), or 'VERBOSE'\n- *(Optional)* closure.compilerOptions = [CompilerOptions](https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/CompilerOptions.java) object\n- *(Optional)* closure.externs = [FileCollection](http://gradle.org/docs/current/javadoc/org/gradle/api/file/FileCollection.html) object\n\n### gzipJs\n- source = File to compress\n- dest = File for compressed output\n\n### jshint\n- source = Files to assess with JSHint\n- dest = File for JSHint output\n- *(Optional)* reporter = Only 'checkstyle' supported right now. Defaults to plain JSHint output.\n- *(Optional)* ignoreExitCode = Fail build if `false` and jshint finds problems. Default is `true`.\n- *(Optional)* outputToStdOut = `true` will output to STDOUT instead of file. Default is `false`.\n- *(Optional)* jshint.options = Map of options (e.g. `[expr: \"true\", unused: \"true\"]`)\n- *(Optional)* jshint.predef = Map of predefined globals so JSHint doesn't complain about them\n\n\n### jsdoc\n- source = Files to generate documentation for\n- destinationDir = Directory path to put JSDoc output\n- *(Optional)* options.options = []\n\n```\nJSDoc 3 options:\n-t or --template \u003cvalue\u003e The name of the template to use. Default: the \"default\" template\n-c or --configure \u003cvalue\u003e The path to the configuration file. Default: jsdoc __dirname + /conf.json\n-e or --encoding \u003cvalue\u003e Assume this encoding when reading all source files. Default: utf-8\n-T or --test Run all tests and quit.\n-d or --destination \u003cvalue\u003e The path to the output folder. Use \"console\" to dump data to the console. Default: console\n-p or --private Display symbols marked with the @private tag. Default: false.\n-r or --recurse Recurse into subdirectories when scanning for source code files.\n-h or --help Print this message and quit.\n-X or --explain Dump all found doclet internals to console and quit.\n-q or --query \u003cvalue\u003e Provide a querystring to define custom variable names/values to add to the options hash.\n-u or --tutorials \u003cvalue\u003e Directory in which JSDoc should search for tutorials.\n```\n\n### props2js\n- source = Properties file to process\n- dest = Destination file for output\n- props.type = One of: 'js', 'json', or 'jsonp'\n- *(Optional)* props.functionName = Function name to wrap JSONP\n\n### requireJs\n- source = Source JS files\n- dest = Output JS file\n- *(Must declare this or `requirejs.options`)* requirejs.buildprofile = File reference for config [example](https://github.com/eriwen/gradle-js-plugin/blob/master/src/test/resources/requirejs/build.js)\n- requirejs.options = Map of options [require.js docs](http://requirejs.org/docs/optimization.html#options)\n- *(Optional)* ignoreExitCode = Fail build if `false` and require.js did not run successfully. Default is `false`.\n- *(Optional)* requirejs.impl = r.js implementation file.  Version 2.1.8 is provided within this plugin.  Specifying this option allows users to specify a version of the require optimizer of their own choosing\n\nWhat, you want more? [Tell me!](https://github.com/eriwen/gradle-js-plugin/issues)\n\n## Contributors\nThis project is made possible due to the efforts of these fine people:\n\n* [Eric Wendelin](http://eriwen.com) - Original author and maintainer\n* [Luke Daley](https://github.com/alkemist) - Advice and improved project structure and testing\n* [Josh Newman](https://github.com/jnewman) - AMD and CommonJS work\n* Martin Ziel - Allowing minifyJs task to accept multiple files as input\n* [Joe Fitzgerald](https://github.com/joefitzgerald) - JSHint and RequireJS features\n* [levsa](https://github.com/levsa) - JSHint predef and checkstyle reporter\n* [Martin Snyder](https://github.com/MartinSnyder) - requireJs impl option\n* [Aaron Arnett](https://github.com/a3rnett) - Remove explicit MavenCentral dependency\n* [sv99](https://github.com/sv99) - Improve Gradle version compatibility\n\n## See Also\nThe [Gradle CSS Plugin](https://github.com/eriwen/gradle-css-plugin)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriwen%2Fgradle-js-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feriwen%2Fgradle-js-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriwen%2Fgradle-js-plugin/lists"}