{"id":17677409,"url":"https://github.com/bluepropane/js-output-file-webpack-plugin","last_synced_at":"2026-02-19T05:01:27.407Z","repository":{"id":48002067,"uuid":"193539013","full_name":"bluepropane/js-output-file-webpack-plugin","owner":"bluepropane","description":"Generates file content based on JS output","archived":false,"fork":false,"pushed_at":"2021-08-11T03:40:57.000Z","size":234,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-22T11:24:36.831Z","etag":null,"topics":["manifest-json","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bluepropane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-24T16:14:32.000Z","updated_at":"2019-10-29T11:36:36.000Z","dependencies_parsed_at":"2022-08-12T16:20:33.082Z","dependency_job_id":null,"html_url":"https://github.com/bluepropane/js-output-file-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/bluepropane/js-output-file-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluepropane%2Fjs-output-file-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluepropane%2Fjs-output-file-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluepropane%2Fjs-output-file-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluepropane%2Fjs-output-file-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluepropane","download_url":"https://codeload.github.com/bluepropane/js-output-file-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluepropane%2Fjs-output-file-webpack-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29604108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T04:38:07.383Z","status":"ssl_error","status_checked_at":"2026-02-19T04:35:50.016Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["manifest-json","webpack","webpack-plugin"],"created_at":"2024-10-24T07:28:36.830Z","updated_at":"2026-02-19T05:01:27.390Z","avatar_url":"https://github.com/bluepropane.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS Output to File Webpack Plugin\n\nLightweight webpack plugin that takes in a JS file and writes its output into a file.\n\nUseful for generating files like [manifest.json](https://developers.google.com/web/fundamentals/web-app-manifest/).\n\n## Installation\n\n```\nyarn add --dev js-output-file-webpack-plugin\n```\n\nor\n\n```\nnpm i --save-dev js-output-file-webpack-plugin\n```\n\n## Usage\n\nIn `webpack.config.js`:\n\n```js\nconst JSOutputFilePlugin = require('js-output-file-webpack-plugin');\n\nconst config = {\n  context: path.join(__dirname, 'src'),\n  output: {\n    path: path.join(__dirname, 'dist')\n  },\n  plugins: [\n    new JSOutputFilePlugin({\n      source: 'manifest.json.js'\n    })\n  ]\n};\n\nmodule.exports = config;\n```\n\nIn `src/manifest.json.js`:\n\n```js\nconst pkg = require('./package.json');\n\nmodule.exports = env =\u003e {\n  const manifest = {\n    name: 'Example manifest',\n    // use some dynamically generated variables\n    version: pkg.version,\n    icons: {\n      '16': 'icons/icon16.png',\n      '48': 'icons/icon48.png',\n      '128': 'icons/icon128.png'\n    },\n    background: {\n      scripts: ['bg.js'],\n      persistent: false\n    }\n  };\n  // environment specific rendering\n  if (env === 'development') {\n    manifest['content_security_policy'] =\n      \"script-src 'self' 'unsafe-eval'; object-src 'self'\";\n  }\n  return manifest;\n};\n```\n\n`JSOutputFilePlugin` will output a file of the same name in output directory, with the `.js` extension stripped.\n\nRunning the webpack compiler will yield `dist/manifest.json`:\n\n```json\n// Prettified for example purposes.\n// Actual JSON output will be minified unless the return value is a string.\n{\n  \"name\": \"Example manifest\",\n  \"version\": \"2.0.1\",\n  \"icons\": {\n    \"16\": \"icons/icon16.png\",\n    \"48\": \"icons/icon48.png\",\n    \"128\": \"icons/icon128.png\"\n  },\n  \"background\": {\n    \"scripts\": [\n      \"bg.js\"\n    ],\n    \"persistent\": false\n  },\n  \"content_security_policy\": \"script-src 'self' 'unsafe-eval'; object-src 'self'\"\n}\n```\n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluepropane%2Fjs-output-file-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluepropane%2Fjs-output-file-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluepropane%2Fjs-output-file-webpack-plugin/lists"}