{"id":18565827,"url":"https://github.com/jsoverson/grunt-preprocess","last_synced_at":"2025-04-13T02:19:01.534Z","repository":{"id":4850332,"uuid":"6004744","full_name":"jsoverson/grunt-preprocess","owner":"jsoverson","description":"Preprocess files based off environment configuration ","archived":false,"fork":false,"pushed_at":"2019-09-06T10:25:17.000Z","size":77,"stargazers_count":294,"open_issues_count":6,"forks_count":41,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-29T20:55:52.579Z","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":"b13/t3ext-dam_falmigration","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsoverson.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":"2012-09-29T00:36:15.000Z","updated_at":"2024-04-17T21:19:29.000Z","dependencies_parsed_at":"2022-09-12T03:01:21.567Z","dependency_job_id":null,"html_url":"https://github.com/jsoverson/grunt-preprocess","commit_stats":null,"previous_names":["onehealth/grunt-preprocess"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsoverson%2Fgrunt-preprocess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsoverson%2Fgrunt-preprocess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsoverson%2Fgrunt-preprocess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsoverson%2Fgrunt-preprocess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsoverson","download_url":"https://codeload.github.com/jsoverson/grunt-preprocess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654364,"owners_count":21140286,"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-06T22:20:35.364Z","updated_at":"2025-04-13T02:19:01.510Z","avatar_url":"https://github.com/jsoverson.png","language":"JavaScript","readme":"# grunt-preprocess\n[![NPM][npm-image]][npm-url]\n\n[![Linux Build Status][linux-ci-image]][linux-ci-url] [![dependencies][deps-image]][deps-url] [![dev-dependencies][dev-deps-image]][dev-deps-url]\n\n\nGrunt task around [preprocess](https://github.com/jsoverson/preprocess) npm module\n\n## What does it look like?\n\n```html\n\u003chead\u003e\n  \u003ctitle\u003eYour App\u003c/title\u003e\n\n  \u003c!-- @if NODE_ENV='production' --\u003e\n  \u003cscript src=\"some/production/lib/like/analytics.js\"\u003e\u003c/script\u003e\n  \u003c!-- @endif --\u003e\n\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003c!-- @ifdef DEBUG --\u003e\n  \u003ch1\u003eDebugging mode - \u003c!-- @echo RELEASE_TAG --\u003e \u003c/h1\u003e\n  \u003c!-- @endif --\u003e\n  \u003cp\u003e\n  \u003c!-- @include welcome_message.txt --\u003e\n  \u003c/p\u003e\n\u003c/body\u003e\n```\n\n```js\nvar configValue = '/* @echo FOO */' || 'default value';\n\n// @ifdef DEBUG\nsomeDebuggingCall()\n// @endif\n\n```\n\nSee preprocess documentation for more information\n\n\n## Getting Started\nInstall this grunt plugin next to your project's Gruntfile with: `npm install --save-dev grunt-preprocess`\n\nThen add this line to your project's Gruntfile:\n\n```javascript\ngrunt.loadNpmTasks('grunt-preprocess');\n```\n\n## Options\n\n#### context\nType: `Object`\nDefault: `{NODE_ENV: 'development'}`\n\nThe additional context on top of ENV that should be passed to templates. If NODE_ENV is not set, the task sets it to `development` by default.\n\n#### inline\nType: `Boolean`\nDefault: `undefined`\n\nRequired to enable overwriting of source files\n\n#### srcDir\nType: `String`\nDefault: `\u003cpath to source file to be processed\u003e`\n\nThe directory where to look for files included via `@include` variants and `@extend`.\n\n#### srcEol\nType: `String`\nDefault: EOL of source file or `os.EOL` if source file contains multiple different or no EOLs.\n\nThe end of line (EOL) character to use for the preprocessed result. May be one of:\n - `\\r\\n` - Windows\n - `\\n` - Linux/OSX/Unix\n - `\\r` - legacy Mac\n\n#### type\nType: `String`\nDefault: file extension of the file to be processed \n\nThe syntax type of source file to preprocess. See [preprocess() description](https://github.com/jsoverson/preprocess#optionstype) for a list of all supported file types.\n\n## Example Usage\n\n```js\npreprocess : {\n  options: {\n    context : {\n      DEBUG: true\n    }\n  },\n  html : {\n    src : 'test/test.html',\n    dest : 'test/test.processed.html'\n  },\n  js : {\n    src : 'test/test.js',\n    dest : 'test/test.processed.js'\n  },\n  multifile : {\n    files : {\n      'test/test.processed.html' : 'test/test.html',\n      'test/test.processed.js'   : 'test/test.js'\n    }\n  },\n  inline : {\n    src : [ 'processed/**/*.js' ],\n    options: {\n      inline : true,\n      context : {\n        DEBUG: false\n      }\n    }\n  },\n  all_from_dir: {\n    src: '**/*.tmpl',\n    ext: '.html',\n    cwd: 'src',\n    dest: 'build',\n    expand: true\n  }\n}\n```\n\n\n[grunt]: https://github.com/gruntjs/grunt\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][grunt].\n\n## Release History\n\n - 5.1.0\n    - Grunt peer dependency tagged \u003e= 0.4.0, dependency updates\n    - added explicit dependency on lodash\n    - added logging for preprocess errors (@marcominetti, #53)\n - 5.0.1 fixed processing of mutifile-style tasks for multiple different file extensions or different containing directories (#50)\n - 5.0.0 bumped preprocess dep to 3.0.2, implemented backward-compatible mapping of old to new options and pass-through for new options (#34, #39, #48)\n - 4.2.0 bumped preprocess dep to 2.3.1, bumped dev dependencies\n - 4.1.0 bumped preprocess dep to 2.1.0\n - 4.0.0 Switched order of context assignment, small change but necessitated major version\n - 3.0.1 Fixed issue arising from undefined options (#19)\n - 3.0.0 Updated dependencies, added merge from global options context to subtask context (#13)\n - 2.3.0 Updated preprocess, changes default handling to html\n - 2.2.0 Delegating to grunt's file.read/write for consistent usage within grunt (e.g. deep writes)\n - 2.1.0 updated preprocess dependency\n - 2.0.0 updated for grunt 0.4.0, moved context override to `context` option\n - 1.3.0 Moved logic to 'preprocess' npm module\n - 1.2.1 Added @include to include external files\n - 1.2.0 Added @include to include external files\n - 1.1.0 Added ability to process multiple destinations in a files block\n - 1.0.0 Changed syntax, added directives\n - 0.4.0 Added support for inline JS directives\n - 0.3.0 Added insert, extended context to all environment\n - 0.2.0 Added simple directive syntax\n - 0.1.0 Initial release\n\n## License\n\nWritten by Jarrod Overson\n\nLicensed under the Apache 2.0 license.\n\n[npm-image]: https://nodei.co/npm/grunt-preprocess.png?downloads=true\n[npm-url]: https://www.npmjs.com/package/grunt-preprocess\n[linux-ci-image]: https://img.shields.io/travis/jsoverson/grunt-preprocess/master.svg?style=flat-square\n[linux-ci-url]: https://travis-ci.org/jsoverson/grunt-preprocess\n[deps-image]: https://img.shields.io/david/jsoverson/grunt-preprocess.svg?style=flat-square\n[deps-url]: https://david-dm.org/jsoverson/grunt-preprocess\n[dev-deps-image]: https://img.shields.io/david/dev/jsoverson/grunt-preprocess.svg?style=flat-square\n[dev-deps-url]: https://david-dm.org/jsoverson/grunt-preprocess#info=devDependencies\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsoverson%2Fgrunt-preprocess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsoverson%2Fgrunt-preprocess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsoverson%2Fgrunt-preprocess/lists"}