{"id":18389548,"url":"https://github.com/anseki/grunt-pre-proc","last_synced_at":"2026-02-06T20:30:57.667Z","repository":{"id":18697130,"uuid":"85093719","full_name":"anseki/grunt-pre-proc","owner":"anseki","description":"The super simple preprocessor for front-end development.","archived":false,"fork":false,"pushed_at":"2024-06-17T01:51:22.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T18:52:05.331Z","etag":null,"topics":["css","front-end","gruntplugin","html","javascript","preprocess","preprocessor"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-15T16:06:36.000Z","updated_at":"2024-06-17T01:50:52.000Z","dependencies_parsed_at":"2024-10-04T23:20:34.603Z","dependency_job_id":null,"html_url":"https://github.com/anseki/grunt-pre-proc","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"e1b058ab00e0f6a584df04c4dd9e5ce1022e4f0b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/anseki/grunt-pre-proc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fgrunt-pre-proc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fgrunt-pre-proc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fgrunt-pre-proc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fgrunt-pre-proc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anseki","download_url":"https://codeload.github.com/anseki/grunt-pre-proc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anseki%2Fgrunt-pre-proc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267475779,"owners_count":24093356,"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-07-28T02:00:09.689Z","response_time":68,"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","gruntplugin","html","javascript","preprocess","preprocessor"],"created_at":"2024-11-06T01:43:43.533Z","updated_at":"2026-02-06T20:30:57.659Z","avatar_url":"https://github.com/anseki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-pre-proc\n\n[![npm](https://img.shields.io/npm/v/grunt-pre-proc.svg)](https://www.npmjs.com/package/grunt-pre-proc) [![GitHub issues](https://img.shields.io/github/issues/anseki/grunt-pre-proc.svg)](https://github.com/anseki/grunt-pre-proc/issues) [![David](https://img.shields.io/david/anseki/grunt-pre-proc.svg)](package.json) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis [Grunt](http://gruntjs.com/) plugin is wrapper of [preProc](https://github.com/anseki/pre-proc).\n\n* [gulp](http://gulpjs.com/) plugin: [gulp-pre-proc](https://github.com/anseki/gulp-pre-proc)\n* [webpack](https://webpack.js.org/) loader: [pre-proc-loader](https://github.com/anseki/pre-proc-loader)\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## Getting Started\n\nThis plugin requires Grunt `~0.4.1`\n\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-pre-proc --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-pre-proc');\n```\n\n## Usage\n\nIn your project's Gruntfile, add a section named `preProc` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  preProc: {\n    deploy: {\n      options: {\n        // Remove `DEBUG` contents from all files in `dir1` directory and all JS files.\n        removeTag: {tag: 'DEBUG', pathTest: ['/path/to/dir1', /\\.js$/]}\n      },\n      expand: true,\n      cwd: 'develop/',\n      src: '**/*',\n      dest: 'public_html/'\n    }\n  }\n});\n```\n\n## Options\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.\n\nIf the `pathTest` is specified, current source file path is tested with the `pathTest`. If there are multiple source files (e.g. `src: ['file1', 'file2']`, `src: '*.js'`, etc.), the first file path is tested.\n\nFor example:\n\n```js\ngrunt.initConfig({\n  preProc: {\n    deploy: {\n      options: {\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      // ...\n    }\n  }\n});\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. (No file is saved.)  \nAlso, you can specify options to call multiple methods, and other methods are not called when the tag was not found.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fgrunt-pre-proc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanseki%2Fgrunt-pre-proc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanseki%2Fgrunt-pre-proc/lists"}