{"id":16856058,"url":"https://github.com/peterblazejewicz/webpack-demo-typescript","last_synced_at":"2026-05-08T14:08:36.325Z","repository":{"id":151364369,"uuid":"102892885","full_name":"peterblazejewicz/webpack-demo-typescript","owner":"peterblazejewicz","description":"As written here: https://survivejs.com/webpack/ but with changes to enhance your typing with TypeScript 2.*","archived":false,"fork":false,"pushed_at":"2018-03-17T21:34:27.000Z","size":197,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T06:33:37.789Z","etag":null,"topics":["javascript","typescript","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterblazejewicz.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}},"created_at":"2017-09-08T18:34:42.000Z","updated_at":"2019-06-08T07:53:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3d1e047-5e86-450f-aea8-cd3d23ebc965","html_url":"https://github.com/peterblazejewicz/webpack-demo-typescript","commit_stats":{"total_commits":57,"total_committers":1,"mean_commits":57.0,"dds":0.0,"last_synced_commit":"9c65c3c47c4b22e7b79b67314c6a95c102dc7825"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterblazejewicz/webpack-demo-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterblazejewicz%2Fwebpack-demo-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterblazejewicz%2Fwebpack-demo-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterblazejewicz%2Fwebpack-demo-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterblazejewicz%2Fwebpack-demo-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterblazejewicz","download_url":"https://codeload.github.com/peterblazejewicz/webpack-demo-typescript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterblazejewicz%2Fwebpack-demo-typescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32783499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"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":["javascript","typescript","webpack"],"created_at":"2024-10-13T14:01:52.050Z","updated_at":"2026-05-08T14:08:36.290Z","avatar_url":"https://github.com/peterblazejewicz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webpack-demo-typescript\n\nFirst: read: https://survivejs.com/webpack/\n\nThis project derives from the original source code  that ships with a book. The code within this project is a mix of TypeScript and ES6 JavaScript. The TypeScript is used for type rich Webpack configuration, splitting in final Webpack configuration composition.\n\n## Information\n\nThis version comes with some TypeScript support. The Webpack configuration is based on types and default support for `.ts` extension with the help of `ts-node`. \nSee [Unambiguous Webpack config with Typescript](https://medium.com/webpack/unambiguous-webpack-config-with-typescript-8519def2cac7) to get some information on the concept. This project took a concept of using TypeScript in Webpack configuration, but modified it for code splitting and composing final configuration.\n\n## Example TypeScript configuration\n\n```ts\nimport webpack from 'webpack';\nimport merge from 'webpack-merge';\nimport { commonConfig, developmentConfig, productionConfig } from './config/';\n\n/**\n * Composes Wepback configuration options into single config\n * @param {{ progress?: string; target?: string }} env\n * @returns {object} webpack configuration\n */\nconst config: (\n    env: {\n        progress?: string;\n        target?: string;\n    },\n) =\u003e webpack.Configuration = env =\u003e {\n    // tslint:disable-next-line:no-console\n    console.log('env', env);\n    switch (env.target) {\n        case 'production':\n            return merge(commonConfig, productionConfig);\n        case 'development':\n        default:\n            return merge(commonConfig, developmentConfig);\n    }\n};\nexport default config;\n```\n\n```ts\nimport webpack from 'webpack';\nimport merge from 'webpack-merge';\nimport { devServer, loadCss } from './parts';\n\nconst developmentConfig: webpack.Configuration = merge([\n    {\n        devServer: devServer({\n            // Customize host/port here if needed\n            host: process.env.HOST,\n            port: process.env.PORT ? +(process.env.PORT || 8080) : undefined,\n        }),\n    } as webpack.Configuration,\n    loadCss({ exclude: /node_modules/ }),\n]);\n\nexport default developmentConfig;\n```\n\n## Author\n\n@peterblazejewicz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterblazejewicz%2Fwebpack-demo-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterblazejewicz%2Fwebpack-demo-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterblazejewicz%2Fwebpack-demo-typescript/lists"}