{"id":22012356,"url":"https://github.com/CesiumGS/strip-pragma-loader","last_synced_at":"2025-07-23T08:32:47.573Z","repository":{"id":37852730,"uuid":"106576315","full_name":"CesiumGS/strip-pragma-loader","owner":"CesiumGS","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-04T18:44:14.000Z","size":28,"stargazers_count":4,"open_issues_count":1,"forks_count":7,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-11-29T15:46:04.435Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CesiumGS.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-10-11T15:58:37.000Z","updated_at":"2023-01-11T01:25:13.000Z","dependencies_parsed_at":"2024-01-04T19:42:14.367Z","dependency_job_id":"6bfa7475-8db5-4370-b776-74ed134d2a1b","html_url":"https://github.com/CesiumGS/strip-pragma-loader","commit_stats":null,"previous_names":["analyticalgraphicsinc/strip-pragma-loader"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesiumGS%2Fstrip-pragma-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesiumGS%2Fstrip-pragma-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesiumGS%2Fstrip-pragma-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesiumGS%2Fstrip-pragma-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CesiumGS","download_url":"https://codeload.github.com/CesiumGS/strip-pragma-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227260749,"owners_count":17754950,"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-30T03:12:07.326Z","updated_at":"2024-11-30T03:12:08.688Z","avatar_url":"https://github.com/CesiumGS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strip-pragma-loader\n\nA [webpack](http://webpack.github.io/) loader that strips code block from between requireJS `includeStart`/`excludeStart` pragma style comments using the [requireJS optimizer syntax](https://github.com/requirejs/r.js/blob/master/build/example.build.js?utm_campaign=improving-frontend-web-performance-using-requirejs-optimiser-2013-jun\u0026utm_medium=post\u0026utm_source=blog#L260).\n\nFor example, this loader would be used to strip out blocks of the following pattern:\n\n```\n//\u003e\u003eincludeStart('debug', pragmas.debug);\nconsole.log('Debugging...');\n//\u003e\u003eincludeEnd('debug');\n```\n\n## Installation\n\nInstall the loader with npm.\n\n```\nnpm install strip-pragma-loader --save-dev\n```\n\n## Usage\n\nIn your webpack configuration object, you'll need to add `strip-pragma-loader` to your list of modules.\n\n```\nmodule: {\n\trules: [{\n\t\ttest: /\\.js$/,\n\t\tenforce: 'pre',\n\t\tuse: [{\n\t\t\tloader: 'strip-pragma-loader',\n\t\t\toptions: {\n\t\t\t\tpragmas: {\n\t\t\t\t\tdebug: true\n\t\t\t\t}\n\t\t\t}\n\t\t}]\n\t}]\n}\n```\n\n## Options \n\nYou can pass options to the loader using the [`options` property](https://webpack.js.org/configuration/module/#rule-options-rule-query).\n\nThe following options are supported:\n\n * `pragmas`: Object with each pragma name and value. A `false` value will strip out and `includeStart` blocks, and a `true` value will strip out and `exlcudeStart` blocks. Defaults to an empty object.\n\nFor example, the following would strip out all blocks beginning with `//\u003e\u003eincludeStart('debug', pragmas.debug);` and ending with `//\u003e\u003eincludeEnd('debug');`:\n\n```\nmodule: {\n\trules: [{\n\t\ttest: /\\.js$/,\n\t\tenforce: 'pre',\n\t\tuse: [{\n\t\t\tloader: 'strip-pragma-loader',\n\t\t\toptions: {\n\t\t\t\tpragmas: {\n\t\t\t\t\tdebug: true\n\t\t\t\t}\n\t\t\t}\n\t\t}]\n\t}]\n}\n```\n\n\u003e See the [RequireJS configuration options](https://github.com/requirejs/r.js/blob/master/build/example.build.js?utm_campaign=improving-frontend-web-performance-using-requirejs-optimiser-2013-jun\u0026utm_medium=post\u0026utm_source=blog#L260) for more information on pragmas.\n\n## Contributions\n\nPull requests are appreciated. Please use the same [Contributor License Agreement (CLA)](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md) used for [Cesium](https://cesiumjs.org/).\n\n---\n\nDeveloped by the Cesium team.\n\n\u003ca href=\"https://cesium.com/\"\u003e\u003cimg alt=\"Cesium\" src=\"doc/cesium.png\" /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCesiumGS%2Fstrip-pragma-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCesiumGS%2Fstrip-pragma-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCesiumGS%2Fstrip-pragma-loader/lists"}