{"id":19960087,"url":"https://github.com/born2net/gulp-comment-swap","last_synced_at":"2025-07-12T03:36:14.121Z","repository":{"id":57257119,"uuid":"50967924","full_name":"born2net/gulp-comment-swap","owner":"born2net","description":null,"archived":false,"fork":false,"pushed_at":"2016-09-22T15:35:54.000Z","size":158,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T22:01:00.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/born2net.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-03T02:28:14.000Z","updated_at":"2016-02-03T16:34:41.000Z","dependencies_parsed_at":"2022-08-25T02:40:52.691Z","dependency_job_id":null,"html_url":"https://github.com/born2net/gulp-comment-swap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/born2net/gulp-comment-swap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-comment-swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-comment-swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-comment-swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-comment-swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/born2net","download_url":"https://codeload.github.com/born2net/gulp-comment-swap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-comment-swap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264931750,"owners_count":23685088,"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":[],"created_at":"2024-11-13T01:53:42.152Z","updated_at":"2025-07-12T03:36:14.094Z","avatar_url":"https://github.com/born2net.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"gulp-comment-swap\n===============\n\nSwap lines with comment in and out if they match regexp\n-------------\n\nSample: comment out all typescript files that contain /\\*webpack\\*/ and comment in all lines that have /\\*systemjs\\*/ (swap)\n\n```\nnpm install gulp-comment-swap -save-dev\n```\n\nand usage:\n\n```\ngulp.task('dev', function (done) {\n    gulp.src('./src/**/*.ts')\n        .pipe(commentSwap(new RegExp('/\\\\*prod\\\\*/'),new RegExp('/\\\\*dev\\\\*/'))).on('error', function(err){\n            console.log('gulp-swap error: ' + err);\n         })\n        .pipe(gulp.dest('./src'));\n    done()\n});\n```\n\nthis is a great way to support both system.js and webpack with Angular2 for example:\n\n```\n **/\n@Component({\n//    template: require('./App2.html'),  /*webpack*/\n\t    templateUrl: '/src/comps/app2/App2.html', /*systemjs*/\n    providers: [HTTP_PROVIDERS],\n    directives: [ROUTER_DIRECTIVES, RouterLink, DividerPanel, Menu, MenuItem, Sliderpanel, Digg, Properties,\n        Notes, Notes1, Notes2, Notes3, Notes4, Notes5, Weather, Logout, Contact, ModalDialog]\n})\nexport class App2 {\n    private screens:any;\n    private commBroker:CommBroker;\n    ...\n```    \n\nthe Gulp with swap between the two packaging systems.\n\nenjoy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborn2net%2Fgulp-comment-swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborn2net%2Fgulp-comment-swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborn2net%2Fgulp-comment-swap/lists"}