{"id":21941870,"url":"https://github.com/se-panfilov/strip-code-loader","last_synced_at":"2026-02-06T19:32:16.499Z","repository":{"id":143350377,"uuid":"114367189","full_name":"se-panfilov/strip-code-loader","owner":"se-panfilov","description":"A webpack loader to remove parts of code based on regular expressions.","archived":false,"fork":false,"pushed_at":"2024-12-12T22:27:50.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-09T23:32:26.802Z","etag":null,"topics":["build","build-tool","strip-code","webpack","webpack-loader","webpack-loader-strip-code","webpack-strip-code"],"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/se-panfilov.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-15T12:14:50.000Z","updated_at":"2024-12-12T22:27:53.000Z","dependencies_parsed_at":"2025-01-27T15:39:24.734Z","dependency_job_id":"a6897350-3060-4696-b886-027571ee437a","html_url":"https://github.com/se-panfilov/strip-code-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/se-panfilov/strip-code-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se-panfilov%2Fstrip-code-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se-panfilov%2Fstrip-code-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se-panfilov%2Fstrip-code-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se-panfilov%2Fstrip-code-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/se-panfilov","download_url":"https://codeload.github.com/se-panfilov/strip-code-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se-panfilov%2Fstrip-code-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29174116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T19:28:14.811Z","status":"ssl_error","status_checked_at":"2026-02-06T19:28:13.420Z","response_time":59,"last_error":"SSL_read: 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":["build","build-tool","strip-code","webpack","webpack-loader","webpack-loader-strip-code","webpack-strip-code"],"created_at":"2024-11-29T03:15:15.547Z","updated_at":"2026-02-06T19:32:16.479Z","avatar_url":"https://github.com/se-panfilov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4ffd0a188386439cb80e9b25adf1252f)](https://www.codacy.com/app/se-panfilov/strip-code-loader?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=se-panfilov/strip-code-loader\u0026amp;utm_campaign=Badge_Grade)\n[![](https://api.codeclimate.com/v1/badges/9a43a0ab347c227334fa/maintainability)](https://codeclimate.com/github/se-panfilov/strip-code-loader/maintainability)\n[![Build Status](https://travis-ci.org/se-panfilov/strip-code-loader.svg?branch=master)](https://travis-ci.org/se-panfilov/strip-code-loader)\n[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/se-panfilov/strip-code-loader/blob/master/LICENSE)\n\n\n[![NPM](https://nodei.co/npm/strip-code-loader.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/vue-notifications/)\n[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n\n--------------------------\nUNDER CONSTRUCTION\n--------------------------\n\n# strip-code-loader\n\nA webkit loader to remove parts of code based on regular expressions.\n\nCan be used to remove sections of code.\n\n### Why? And what it does?\n\n_Why_: For example you may want to remove code from production builds, but keep it in development and test environments.\n\nUsefull to remove code from production builds that are only needed in development and test environments, or to remove custom internationalized information.\n_What it does_: This plugin uses start and end comments to identify the code sections to strip out. For example:\n\n\n```js\n/*START.TESTS_ONLY*/\nVueNotifications._private = {} //'_private' object would be exist only during the test time\nVueNotifications._private.getVersion = getVersion // And I would be able to test 'getVersion' function (otherwise it won't be accesible because of the closure\n/*END.TESTS_ONLY*/\n```\n(example from [vue-notifications](https://github.com/se-panfilov/vue-notifications) library)\n\nor a bit simpler:\n\n```js\n/* test-code */\nremoveMeInProduction();\n/* end-test-code */\n\ndoNotRemoveMe();\n```\n\n**Attention**: You have to use `/* ... */` for such comments, not just `// ...`\n\n## Getting Started\nFirst, install `strip-code-loader` as a development dependency:\n\n```shell\nnpm i strip-code-loader --save-dev\n#or\nyarn add strip-code-loader --dev\n```\n\n## Example config\n\nTODOTODOTODO\nTODOTODOTODO\nTODOTODOTODO\nTODOTODOTODO\n\nWOAH-WOAH, what if I want to **remove the comments conditionnaly**?\n\nYou may use [strip-code-loader](https://github.com/AgronKabashi/strip-code-loader) plugin for that case, for instance:\n\n```js\nconst isProduction = process.env.buildTarget === \"production\" //assuming you'd run it with something like \"cross-env BABEL_ENV=production \u0026\u0026 rollup -c\"\n...\nplugins: [\n  conditional(isProduction, [\n    stripCode({\n      start_comment: 'START.TESTS_ONLY',\n      end_comment: 'END.TESTS_ONLY'\n    })\n  ])\n]\n...\n```\n\n### Options\n\n#### options.start_comment\nType: `String`\nDefault value: `start_comment`\n\nThe text inside the opening comment used to identify code to strip.\n\n#### options.end_comment\nType: `String`\nDefault value: `end_comment`\n\nThe text inside the closing comment used to identify code to strip.\n\n#### options.pattern\nType: `RegExp`\nDefault value: (a generated RegExp matching the start and end comments)\n\nIf the default start and end comment matching doesn't work for you needs, you can supply your own RegExp to match against. If the `pattern` option is specified, the `start_comment` and `end_comment` options are ignored.\n\n## Tests\n\n```shell\nnpm test\n```\n\n## Same plugins for another tools\n\n - Rollup [rollup-plugin-strip-code](https://github.com/se-panfilov/rollup-plugin-strip-code)\n - Grunt [grunt-strip-code](https://github.com/nuzzio/grunt-strip-code)\n - Gulp [gulp-strip-code](https://github.com/massick/gulp-strip-code)\n\n## Contributing\nFeel free and go ahead.\n\n## License\n\nMIT License\n\nCopyright (c) 2017 Sergei Panfilov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Legal Disclaimer\n\nThis project is provided \"as is\", without warranty of any kind. The authors and contributors disclaim all liability for any damages arising from its use, inability to use, or performance. Users are responsible for ensuring compliance with applicable laws and regulations in their jurisdiction, including but not limited to:\n\n- European Union: Cyber Resilience Act (CRA) and Artificial Intelligence Act (AI Act)\n- United States: Uniform Commercial Code (UCC) and Export Administration Regulations (EAR)\n- China: Cybersecurity Law\n- India: Information Technology Act\n\nFor details, see the full [DISCLAIMER.md](DISCLAIMER.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse-panfilov%2Fstrip-code-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fse-panfilov%2Fstrip-code-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse-panfilov%2Fstrip-code-loader/lists"}