{"id":18389577,"url":"https://github.com/anseki/pre-proc-loader","last_synced_at":"2025-09-03T13:35:30.932Z","repository":{"id":57329397,"uuid":"85066379","full_name":"anseki/pre-proc-loader","owner":"anseki","description":"preProc loader module for webpack - The super simple preprocessor for front-end development.","archived":false,"fork":false,"pushed_at":"2023-01-09T22:17:15.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T23:55:19.020Z","etag":null,"topics":["css","front-end","html","javascript","loader","preprocess","preprocessor","webpack"],"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/anseki.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}},"created_at":"2017-03-15T11:51:04.000Z","updated_at":"2022-08-19T03:40:16.000Z","dependencies_parsed_at":"2023-02-08T14:45:26.398Z","dependency_job_id":null,"html_url":"https://github.com/anseki/pre-proc-loader","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/anseki/pre-proc-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpre-proc-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpre-proc-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpre-proc-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpre-proc-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anseki","download_url":"https://codeload.github.com/anseki/pre-proc-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fpre-proc-loader/sbom","scorecard":{"id":198023,"data":{"date":"2025-08-11","repo":{"name":"github.com/anseki/pre-proc-loader","commit":"e5d6196e26d6214711c08ee28c082da3883f12e4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T22:11:41.391Z","repository_id":57329397,"created_at":"2025-08-16T22:11:41.391Z","updated_at":"2025-08-16T22:11:41.391Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273453050,"owners_count":25108469,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["css","front-end","html","javascript","loader","preprocess","preprocessor","webpack"],"created_at":"2024-11-06T01:43:48.396Z","updated_at":"2025-09-03T13:35:30.882Z","avatar_url":"https://github.com/anseki.png","language":"JavaScript","readme":"# pre-proc-loader\n\n[![npm](https://img.shields.io/npm/v/pre-proc-loader.svg)](https://www.npmjs.com/package/pre-proc-loader) [![GitHub issues](https://img.shields.io/github/issues/anseki/pre-proc-loader.svg)](https://github.com/anseki/pre-proc-loader/issues) [![David](https://img.shields.io/david/anseki/pre-proc-loader.svg)](package.json) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n[preProc](https://github.com/anseki/pre-proc) loader module for [webpack](https://webpack.js.org/).\n\n* [Grunt](http://gruntjs.com/) plugin: [grunt-pre-proc](https://github.com/anseki/grunt-pre-proc)\n* [gulp](http://gulpjs.com/) plugin: [gulp-pre-proc](https://github.com/anseki/gulp-pre-proc)\n\nThe super simple preprocessor for front-end development.  \nSee [preProc](https://github.com/anseki/pre-proc) for options and more information about preProc.\n\n## Installation\n\n```\nnpm install --save-dev pre-proc-loader pre-proc\n```\n\n## Usage\n\nDocumentation:\n\n- [Loaders](https://webpack.js.org/concepts/loaders/)\n- [Using loaders](http://webpack.github.io/docs/using-loaders.html) (for webpack v1)\n\nFor example:\n\n```js\n// app.js\n\n// The line below is removed.\nTEST_MODE = true; // [DEBUG/]\n\n// The HTML code for \"button A\" is picked from buttons.html file, and it inserted to \"panel\".\nvar buttonA = require('./buttons.html?tag=BUTTON-A'); // `tag` argument for pickTag method.\ndocument.getElementById('panel').innerHTML = buttonA;\n```\n\n```js\n// webpack.config.js\nmodule.exports = {\n  entry: './app.js',\n  output: {\n    filename: 'bundle.js'\n  },\n  module: {\n    rules: [\n      {\n        test: /\\/develop\\//,\n        loader: 'pre-proc-loader',\n        // Remove `DEBUG` contents from all files in `dir1` directory and all JS files.\n        options: {removeTag: {tag: 'DEBUG', pathTest: ['/path/to/dir1', /\\.js$/]}}\n      },\n      {\n        test: /\\.html$/,\n        loader: 'pre-proc-loader',\n        options: {pickTag: {}} // `tag` is specified via query string\n      }\n    ]\n  }\n};\n```\n\n## Options\n\nYou can specify options via query parameters or an `options` (or `preProcLoader` for webpack v1) object in webpack configuration.\n\n### `removeTag`\n\nIf `removeTag` option is specified, call [`removeTag`](https://github.com/anseki/pre-proc#removetag) method with current content.\n\nYou can specify an object that has properties as arguments of the method.  \nFollowing properties are accepted:\n\n- `tag`\n- `pathTest`\n\nAlso, you can specify common values for the arguments into upper layer. That is, the `options.pathTest` is used when `options.removeTag.pathTest` is not specified.  \nAnd also, you can specify values for `tag` argument via a query string with the resource file like `?tag=TAG`, and it is the first-priority value. An array also can be specified, like `?tag[]=TAG1,tag[]=TAG2`, `?{tag:[TAG1,TAG2]}` or `?tag=TAG1%2CTAG2` (or `?tag=TAG1%20TAG2`, i.e. the values separated by space or comma).\n\nIf the `pathTest` is specified, current source file path is tested with the `pathTest`.\n\nFor example:\n\n```js\n// webpack.config.js\n// ...\n// pre-proc-loader options\n{\n  tag: 'DEBUG',           // common\n  pathTest: '/path/to',   // common\n\n  removeTag: {},                            // tag: 'DEBUG', pathTest: '/path/to'\n  replaceTag: {tag: ['SPEC1', 'SPEC2']},    // tag: ['SPEC1', 'SPEC2'], pathTest: '/path/to'\n  pickTag: {}                               // tag: 'DEBUG', pathTest: '/path/to'\n}\n// For `file.html?tag=SPEC3` resource, the `SPEC3` is used for all method.\n```\n\n### `replaceTag`\n\nIf `replaceTag` option is specified, call [`replaceTag`](https://github.com/anseki/pre-proc#replacetag) method with current content.\n\nYou can specify arguments by the same way as the [`removeTag`](#removetag).  \nFollowing arguments are accepted:\n\n- `tag`\n- `pathTest`\n- `replacement` (As `options.replaceTag.replacement`, not `options.replacement`)\n\n### `pickTag`\n\nIf `pickTag` option is specified, call [`pickTag`](https://github.com/anseki/pre-proc#picktag) method with current content.\n\nYou can specify arguments by the same way as the [`removeTag`](#removetag).  \nFollowing arguments are accepted:\n\n- `tag`\n- `allowErrors` (As `options.pickTag.allowErrors`, not `options.allowErrors`)\n\nWhen the tag was not found, this method throws an error by default. If `true` is specified for `allowErrors`, it returns `null` (not a string) without error. It is useful for handling unknown source code.  \nAlso, you can specify options to call multiple methods, and other methods are not called when the tag was not found.\n\n### `toCode`\n\n*Type:* boolean  \n*Default:* `false`\n\nWhen the content is not JavaScript code (e.g. HTML, CSS, JSON, etc.), a loader that is specified as a final loader has to convert the content to JavaScript code and output it to allow another code to import the content.  \nIf `true` is specified for `toCode` option, the content is converted to JavaScript code.  \nIf the loader is specified as not a final loader, this option is ignored (i.e. the content is not converted, and it is passed to next loader).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fpre-proc-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanseki%2Fpre-proc-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fpre-proc-loader/lists"}