{"id":16860448,"url":"https://github.com/pvdlg/karma-postcss-preprocessor","last_synced_at":"2026-04-28T00:33:14.545Z","repository":{"id":66097292,"uuid":"97074749","full_name":"pvdlg/karma-postcss-preprocessor","owner":"pvdlg","description":"Karma preprocessor to compile css files with postcss with sourcemap and watch support","archived":false,"fork":false,"pushed_at":"2020-03-27T05:16:04.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-02T13:10:08.461Z","etag":null,"topics":["karma","karma-plugin","karma-preprocessor","postcss","sourcemaps","watcher"],"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/pvdlg.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-13T03:09:26.000Z","updated_at":"2020-03-27T04:15:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"69a4bbdd-f5dd-4c31-a1a2-09d6b104399c","html_url":"https://github.com/pvdlg/karma-postcss-preprocessor","commit_stats":null,"previous_names":["vanduynslagerp/karma-postcss-preprocessor"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/pvdlg/karma-postcss-preprocessor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdlg%2Fkarma-postcss-preprocessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdlg%2Fkarma-postcss-preprocessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdlg%2Fkarma-postcss-preprocessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdlg%2Fkarma-postcss-preprocessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvdlg","download_url":"https://codeload.github.com/pvdlg/karma-postcss-preprocessor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvdlg%2Fkarma-postcss-preprocessor/sbom","scorecard":{"id":750505,"data":{"date":"2025-08-11","repo":{"name":"github.com/pvdlg/karma-postcss-preprocessor","commit":"ae785d38c49f6b8aa53c1bb4a6d568a9f0d61386"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/4 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":"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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T20:12:30.554Z","repository_id":66097292,"created_at":"2025-08-22T20:12:30.554Z","updated_at":"2025-08-22T20:12:30.554Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["karma","karma-plugin","karma-preprocessor","postcss","sourcemaps","watcher"],"created_at":"2024-10-13T14:24:11.053Z","updated_at":"2026-04-28T00:33:14.516Z","avatar_url":"https://github.com/pvdlg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **karma-postcss-preprocessor**\n\nKarma preprocessor to compile postcss and scss files with [Postcss](https://github.com/postcss/postcss).\n\n[![Travis](https://img.shields.io/travis/pvdlg/karma-postcss-preprocessor.svg)](https://travis-ci.org/pvdlg/karma-postcss-preprocessor)\n[![AppVeyor](https://img.shields.io/appveyor/ci/pvdlg/karma-postcss-preprocessor.svg)](https://ci.appveyor.com/project/pvdlg/karma-postcss-preprocessor)\n[![Codecov](https://img.shields.io/codecov/c/github/pvdlg/karma-postcss-preprocessor.svg)](https://codecov.io/gh/pvdlg/karma-postcss-preprocessor)\n[![Greenkeeper badge](https://badges.greenkeeper.io/pvdlg/karma-postcss-preprocessor.svg)](https://greenkeeper.io/)\n[![license](https://img.shields.io/github/license/pvdlg/karma-postcss-preprocessor.svg)](https://github.com/pvdlg/karma-postcss-preprocessor/blob/master/LICENSE)\n\n## Installation\n\n```bash\nnpm install postcss @metahub/karma-postcss-preprocessor --save-dev\n```\n\n[Postcss plugins](https://www.postcss.parts) have to be installed individually. For example:\n\n```bash\nnpm install autoprefixer cssnano --save-dev\n```\n\n## Configuration\n\nAll the [postcss](http://api.postcss.org/global.html#processOptions) options can be passed to `postcssPreprocessor.options`.\n\nIn addition the preprocessor accept a `transformPath` function, to rewrite the path on which the files are deployed on the Karma webserver. If not specified, the processed files will be accessible with the same paths as the originals. For example `test/fixtures/myStyle.css` will be deployed as `base/test/fixtures/myStyle.css`.\n\n### Standard\n\n```js\nconst autoprefixer = require('autoprefixer');\nconst cssnano = require('cssnano');\n\nmodule.exports = function(config) {\n  config.set({\n    files: ['src/sass/main.css'],\n\n    plugins: ['@metahub/karma-postcss-preprocessor', 'karma-*'],\n    preprocessors: {\n      '**/*.css': ['postcss'],\n    },\n\n    postcssPreprocessor: {\n      options: {\n        // To include inlined sourcemaps as data URIs\n        map: true,\n        plugins: [autoprefixer, cssnano],\n      },\n      // File test/fixtures/main.ccs will be accessible in the unit test on path base/styles/main.css\n      transformPath: filePath =\u003e filePath.replace('test/fixtures/', 'styles/')\n    },\n  });\n};\n```\n**_Note: Karma can auto-load plugins named `karma-*` (see [plugins](http://karma-runner.github.io/1.0/config/plugins.html)). Unfortunatly it doesn't work with [scoped packages](https://docs.npmjs.com/misc/scope), therefore `@metahub/karma-postcss-preprocessor` has to be explicitly added to the `plugins` configuration. In order to continue to automatically load other plugins you can add `karma-*` to the `plugins` configuration._**\n\n**_Note: `@metahub/karma-postcss-preprocessor` embed its own watcher to monitor imported dependencies, therefore only the main entry point has to be configured in Karma. If Karma is configured with `autoWatch: true`, the modification of an imported css file will trigger a new build and test run._**\n\n### Configured Preprocessors\nSee [configured preprocessors](http://karma-runner.github.io/1.0/config/preprocessors.html).\n\n```js\nconst autoprefixer = require('autoprefixer');\nconst cssnano = require('cssnano');\n\nmodule.exports = function(config) {  \n  config.set({\n    files: ['src/sass/main.css', 'test/fixtures/myFixture.css'],\n\n    plugins: ['@metahub/karma-postcss-preprocessor', 'karma-*'],\n    preprocessors: {\n      'src/**/*.css': ['postcss_1'],\n      'test/fixtures/**/*.css': ['postcss_2'],\n    },\n\n    customPreprocessors: {\n      postcss_1: {\n        base: 'postcss',\n        options: {\n          plugins: [autoprefixer, cssnano]\n          map: true,\n        },\n        // File test/fixtures/myFixture.ccs will be accessible in the unit test on path test/fixtures/myFixture.min.ccs\n        transformPath: filePath =\u003e filePath.replace(/\\.css$/, '.min.css')\n      },\n      postcss_2: {\n        base: 'postcss',\n        options: {\n          plugins: [autoprefixer],\n        },\n      },\n    },\n  });\n};\n```\n\n### With karma-sass-preprocessor\n\nTo compile sass/scss files with [node-sass](https://github.com/sass/node-sass) then process them with [Postcss](https://github.com/postcss/postcss) you can use [@metahub/karma-sass-preprocessor](https://github.com/pvdlg/karma-sass-preprocessor).\n\n```bash\nnpm install node-sass @metahub/karma-sass-preprocessor --save-dev\n```\n\n```js\nconst autoprefixer = require('autoprefixer');\nconst cssnano = require('cssnano');\n\nmodule.exports = function(config) {\n  config.set({\n    files: ['src/sass/main.scss', 'test/fixtures/myFixture.scss'],\n\n    plugins: ['@metahub/karma-sass-preprocessor', '@metahub/karma-postcss-preprocessor', 'karma-*'],\n    preprocessors: {\n      'src/**/*.scss': ['sass', 'postcss'],\n      'test/fixtures/**/*.scss': ['sass', 'postcss'],\n    },\n\n    sassPreprocessor: {\n      options: {\n        sourceMap: true,\n      },\n    },\n    postcssPreprocessor: {\n      options: {\n        map: true,\n        plugins: [autoprefixer, cssnano],\n      },\n    },\n  });\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvdlg%2Fkarma-postcss-preprocessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvdlg%2Fkarma-postcss-preprocessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvdlg%2Fkarma-postcss-preprocessor/lists"}