{"id":13727057,"url":"https://github.com/sysgears/webpack-virtual-modules","last_synced_at":"2025-10-24T19:38:50.921Z","repository":{"id":38551993,"uuid":"86308600","full_name":"sysgears/webpack-virtual-modules","owner":"sysgears","description":"Webpack Virtual Modules is a webpack plugin that lets you create, modify, and delete in-memory files in a way that webpack treats them as if they were physically presented in the file system.","archived":false,"fork":false,"pushed_at":"2025-04-08T17:58:36.000Z","size":634,"stargazers_count":518,"open_issues_count":3,"forks_count":43,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-10-14T16:35:39.928Z","etag":null,"topics":["modules","overlay","virtual","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sysgears.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,"zenodo":null}},"created_at":"2017-03-27T08:12:09.000Z","updated_at":"2025-09-14T14:42:29.000Z","dependencies_parsed_at":"2023-01-27T05:46:11.676Z","dependency_job_id":"358d50ab-df13-47a4-a763-d9de9616a934","html_url":"https://github.com/sysgears/webpack-virtual-modules","commit_stats":{"total_commits":113,"total_committers":20,"mean_commits":5.65,"dds":"0.33628318584070793","last_synced_commit":"35a2341f92b80f2b7aedafc58eafa2e358d7e09c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sysgears/webpack-virtual-modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fwebpack-virtual-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fwebpack-virtual-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fwebpack-virtual-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fwebpack-virtual-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysgears","download_url":"https://codeload.github.com/sysgears/webpack-virtual-modules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysgears%2Fwebpack-virtual-modules/sbom","scorecard":{"id":863865,"data":{"date":"2025-08-11","repo":{"name":"github.com/sysgears/webpack-virtual-modules","commit":"fb08bd1674b4a8f7709aa08f408df46ea988d003"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":3,"reason":"Found 9/30 approved changesets -- score normalized to 3","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build-and-test.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-and-test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sysgears/webpack-virtual-modules/build-and-test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-and-test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sysgears/webpack-virtual-modules/build-and-test.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/build-and-test.yml:26","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 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-24T02:09:03.457Z","repository_id":38551993,"created_at":"2025-08-24T02:09:03.457Z","updated_at":"2025-08-24T02:09:03.457Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280841251,"owners_count":26400401,"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-10-24T02:00:06.418Z","response_time":73,"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":["modules","overlay","virtual","webpack","webpack-plugin"],"created_at":"2024-08-03T01:03:37.767Z","updated_at":"2025-10-24T19:38:50.905Z","avatar_url":"https://github.com/sysgears.png","language":"TypeScript","readme":"# Webpack Virtual Modules\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n\n**Webpack Virtual Modules** is a plugin that allows for dynamical generation of in-memory virtual modules for JavaScript\nbuilds created with webpack. When virtual module is created all the parent virtual dirs that lead to the module filename are created too. This plugin supports watch mode meaning any write to a virtual module is seen by webpack as\nif a real file stored on disk has changed.\n\n## Installation\n\nUse NPM or Yarn to install Webpack Virtual Modules as a development dependency:\n\n```bash\n# with NPM\nnpm install webpack-virtual-modules --save-dev\n\n# with Yarn\nyarn add webpack-virtual-modules --dev\n```\n\n## Usage\n\nYou can use Webpack Virtual Modules with webpack 5, 4 and 3. The examples below show the usage with webpack 5 or 4. If you want to use our plugin with webpack 3, check out a dedicated doc:\n\n* [Webpack Virtual Modules with Webpack 3]\n\n### Generating static virtual modules\n\nRequire the plugin in the webpack configuration file, then create and add virtual modules in the `plugins` array in the\nwebpack configuration object:\n\n```js\nvar VirtualModulesPlugin = require('webpack-virtual-modules');\n\nvar virtualModules = new VirtualModulesPlugin({\n  'node_modules/module-foo.js': 'module.exports = { foo: \"foo\" };',\n  'node_modules/module-bar.js': 'module.exports = { bar: \"bar\" };'\n});\n\nmodule.exports = {\n  // ...\n  plugins: [\n    virtualModules\n  ]\n};\n```\n\nYou can now import your virtual modules anywhere in the application and use them:\n\n```js\nvar moduleFoo = require('module-foo');\n// You can now use moduleFoo\nconsole.log(moduleFoo.foo);\n```\n\n### Generating dynamic virtual modules\n\nYou can generate virtual modules **_dynamically_** with Webpack Virtual Modules.\n\nHere's an example of dynamic generation of a module. All you need to do is create new virtual modules using the plugin\nand add them to the `plugins` array. After that, you need to add a webpack hook. For using hooks, consult [webpack\ncompiler hook documentation].\n\n```js\nvar webpack = require('webpack');\nvar VirtualModulesPlugin = require('webpack-virtual-modules');\n\n// Create an empty set of virtual modules\nconst virtualModules = new VirtualModulesPlugin();\n\nvar compiler = webpack({\n  // ...\n  plugins: [\n    virtualModules\n  ]\n});\n\ncompiler.hooks.compilation.tap('MyPlugin', function(compilation) {\n  virtualModules.writeModule('node_modules/module-foo.js', '');\n});\n\ncompiler.watch();\n```\n\nIn other module or a Webpack plugin, you can write to the module `module-foo` whatever you need. After this write,\nwebpack will \"see\" that `module-foo.js` has changed and will restart compilation.\n\n```js\nvirtualModules.writeModule(\n  'node_modules/module-foo.js',\n  'module.exports = { foo: \"foo\" };'\n);\n```\n\n## More Examples\n\n  - [Swagger and JSDoc Example with Webpack 5]\n  - [Swagger and JSDoc Example with Webpack 4]\n  - [Swagger and JSDoc Example with Webpack 3]\n\n## API Reference\n\n  - [API Reference]\n\n## Inspiration\n\nThis project is inspired by [virtual-module-webpack-plugin].\n\n## Contributing\n\nThis project uses [nari] package manager to have reproducible builds without resorting to lockfiles, it uses `lockTime` field in `package.json` instead.\n\nTo install `nari` execute:\n`npm i -g nari`\n\nAnd then `nari` to install the project.\n\nTo run project scripts use `nari script_name`, for example `nari test` to run unit tests.\n\n## License\n\nCopyright © 2017 [SysGears (Cyprus) Limited]. This source code is licensed under the [MIT] license.\n\n[nari]: https://github.com/narijs/nari\n[webpack virtual modules with webpack 3]: https://github.com/sysgears/webpack-virtual-modules/tree/master/docs/webpack3.md\n[webpack compiler hook documentation]: https://webpack.js.org/api/compiler-hooks/\n[swagger and jsdoc example with webpack 3]: https://github.com/sysgears/webpack-virtual-modules/tree/master/examples/swagger-webpack3\n[swagger and jsdoc example with webpack 4]: https://github.com/sysgears/webpack-virtual-modules/tree/master/examples/swagger-webpack4\n[swagger and jsdoc example with webpack 5]: https://github.com/sysgears/webpack-virtual-modules/tree/master/examples/swagger-webpack5\n[api reference]: https://github.com/sysgears/webpack-virtual-modules/tree/master/docs/API%20Reference.md\n[virtual-module-webpack-plugin]: https://github.com/rmarscher/virtual-module-webpack-plugin\n[MIT]: LICENSE\n[SysGears (Cyprus) Limited]: http://sysgears.com\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/webpack-virtual-modules?style=flat\n[npm-version-href]: https://npmjs.com/package/webpack-virtual-modules\n[npm-downloads-src]: https://img.shields.io/npm/dm/webpack-virtual-modules?style=flat\n[npm-downloads-href]: https://npmjs.com/package/webpack-virtual-modules\n[license-src]: https://img.shields.io/github/license/sysgears/webpack-virtual-modules.svg?style=flat\n[license-href]: https://github.com/sysgears/webpack-virtual-modules/blob/main/LICENSE\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysgears%2Fwebpack-virtual-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysgears%2Fwebpack-virtual-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysgears%2Fwebpack-virtual-modules/lists"}