{"id":15048117,"url":"https://github.com/github/webpack-config-github","last_synced_at":"2025-10-04T07:31:12.094Z","repository":{"id":65974909,"uuid":"110906175","full_name":"github/webpack-config-github","owner":"github","description":"An opinionated webpack config for GitHub apps.","archived":true,"fork":false,"pushed_at":"2020-08-03T15:43:16.000Z","size":134,"stargazers_count":47,"open_issues_count":0,"forks_count":21,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-13T21:36:20.966Z","etag":null,"topics":[],"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/github.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":"2017-11-16T01:17:06.000Z","updated_at":"2024-07-31T03:17:26.000Z","dependencies_parsed_at":"2023-02-19T18:01:13.974Z","dependency_job_id":null,"html_url":"https://github.com/github/webpack-config-github","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fwebpack-config-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fwebpack-config-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fwebpack-config-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fwebpack-config-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/webpack-config-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235227462,"owners_count":18956137,"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-09-24T21:08:23.210Z","updated_at":"2025-10-04T07:31:06.796Z","avatar_url":"https://github.com/github.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# webpack-config-github\n\nAn opinionated [webpack](https://webpack.js.org/) config for GitHub apps.\n\n## Features\n\n* Single and multiple HTML entry points\n* Common chunks bundle when using multiple entry points\n* ES6 transpilation via Babel\n* Source Maps\n* PostCSS\n* HTML5 History routing (in development)\n* GraphQL proxy (in development)\n* [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)\n* HTML and JS minification (in production)\n* Static gzip compression (in production)\n* Docker nginx deployment\n\n## Deployment\n\nCurrently targets the [Docker nginx](https://hub.docker.com/_/nginx/) deployment environment. Improved gh-pages\ndeployment is planned in the future.\n\n## Basic Setup\n\n```sh\n$ npm install --save-dev webpack-dev-server\n$ npm install --save-dev webpack-config-github\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = require('webpack-config-github')\n```\n\n**src/index.js**\n\n```js\ndocument.body.innerHTML = '\u003ch1\u003eHello, World!\u003c/h1\u003e'\n```\n\n**Start development server**\n\n```sh\n$ webpack-dev-server --open\n```\n\n## Directory Structure\n\n```\nmy-app\n├── package.json\n├── Dockerfile\n├── config\n│   └── nginx.conf\n├── .graphqlconfig\n├── data\n│   └── schema.graphql\n├── node_modules\n├── public\n│   └── favicon.ico\n│   └── robots.txt\n└── src\n    └── index.js\n    └── components\n        └── App.js\n        └── Layout.js\n        └── Sidebar.js\n```\n\n**Dockerfile**\n\nThe currently suggested deployment target is the [Docker nginx image](https://hub.docker.com/_/nginx/).\n\nSee the [example `Dockerfile`](/examples/docker/Dockerfile).\n\n**config/nginx.conf**\n\nThis [example `nginx.conf`](/examples/docker/config/nginx.conf) aligns the static serving with the `webpack-dev-server`.\n\n**.graphqlconfig**\n\nSpecifies the location of the GraphQL schema and target endpoints.\n\nHere is an example configuration file when targeting the GitHub GraphQL API.\n\n```json\n{\n  \"schemaPath\": \"data/schema.graphql\",\n  \"extensions\": {\n    \"endpoints\": {\n      \"production\": {\n        \"url\": \"https://api.github.com/graphql\",\n        \"headers\": {\n          \"Authorization\": \"Bearer ${env:API_TOKEN}\"\n        }\n      }\n    }\n  }\n}\n```\n\nSee the [GraphQL Configuration Format](https://github.com/graphcool/graphql-config/blob/master/specification.md) for\nmore information.\n\n**data/schema.graphql**\n\nWhen using Relay, a copy of the GraphQL schema should be checked in at this location. Checking the schema in ensures\nlinting and build tools can be consistently ran offline and in CI.\n\n**public/**\n\nThe `public/` directory contains static assets that will be exposed as is. This is useful for well known static assets\nthat need to be served at a specific root path like `favicon.ico` and `robots.txt`.\n\n**src/**\n\nContains source JavaScript, CSS and other assets that will be compiled via webpack.\n\n**src/index.js**\n\nIs the main entry point for bootstrapping the application.\n\nWhen using React, this file should render the root application component.\n\n```js\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport App from './components/App'\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'))\n```\n\n## Roadmap\n\n* Add Subresource Integrity support\n* Support CSS Modules\n* Support hot reloading\n* Add gh-pages deployment pattern\n\n## See Also\n\nMany of the directory conventions used here are inspired from\n[create-react-app](https://github.com/facebookincubator/create-react-app).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fwebpack-config-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fwebpack-config-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fwebpack-config-github/lists"}