{"id":19522214,"url":"https://github.com/captaincodeman/angular2-webpack-polyfill","last_synced_at":"2025-04-26T09:32:07.227Z","repository":{"id":66357869,"uuid":"53087993","full_name":"CaptainCodeman/angular2-webpack-polyfill","owner":"CaptainCodeman","description":"A simple starter example showing Angular2 bundled using webpack with polyfill.io service.","archived":false,"fork":false,"pushed_at":"2016-08-10T15:35:32.000Z","size":24,"stargazers_count":18,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-04T10:33:58.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://captain-codeman.appspot.com/","language":"TypeScript","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/CaptainCodeman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-03-03T22:11:06.000Z","updated_at":"2022-11-21T06:26:52.000Z","dependencies_parsed_at":"2023-02-23T04:16:01.391Z","dependency_job_id":null,"html_url":"https://github.com/CaptainCodeman/angular2-webpack-polyfill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fangular2-webpack-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fangular2-webpack-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fangular2-webpack-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fangular2-webpack-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CaptainCodeman","download_url":"https://codeload.github.com/CaptainCodeman/angular2-webpack-polyfill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250967238,"owners_count":21515564,"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-11-11T00:37:47.960Z","updated_at":"2025-04-26T09:32:07.218Z","avatar_url":"https://github.com/CaptainCodeman.png","language":"TypeScript","readme":"#Angular2 Webpack Polyfill\nA simple starter example showing Angular 2 bundled using webpack with the [polyfill.io](http://polyfill.io)\nservice and core.js for cross browser compatibility. Core.js can be loaded from a CDN or added to the\nvendor bundle depending on your preference.\n\nWhen this project was originally created, correctly loading the polyfills for all the browsers\npromised to be supported by Angular 2 was often confusing and used different libraries that had\nperformance issues. There were also lots of unecessary dependencies added to a project which was\nclutter and this was an attempt to simplify everything.\n\nYou can see a [live example](http://captain-codeman.appspot.com/) of the app - explore the\nnetwork tab to see the polyfill requests and vendor / app bundle sizes. The RC4 version of these\nare currently 722Kb + 3Kb or 165Kb + 1.3Kb when gzipped. Polyfills are another ~27.8Kb (if using\nChrome).\n\n## Webpack Build\nAlthough there were already some webpack projects when this was created, I found many of them to be\ntoo big and too complex for learning. The Webpack configuration in this project is meant to be\nthe bare bones showing how to have some shared configuration, a devlopement build and a production\nbuild with hashed filenames for long-term cacheability plus minification. It's been used as the\nbasis for more comprehensive applications (including sass, bootstrap, 3rd party JS libs etc...).\n\nThe initial quickstart and CLI tools for Angular 2 seemed to favor builds based on System.js\nand unfortunately this seemed to cause issues for lots of new users (confusion around configuration\nand performance with hundreds of requests and multi Mb downloads if bundling wasn't used). They\nnow appear to be also moving to Webpack as the preferred solution.\n\n## Polyfill service\nThe polyfill downloaded is based on the browser user agent. The lack of Intl support in Safari\nis the reason for it being the largest (currently used in things such as number pipe formatting).\nUsing the separate polyfill service prevents other browser users from having to pay the download\nprice for Safari and IE support. If polyfills were added directly to the bundle then users with\nbrowsers that have native support (such as Chrome) would be forced to download and evaluate code\nthat is not required.\n\nFundamentally, polyfills should not be added to your application code or bundle - they are meant\nto be a temporary solution to bring a browser up to spec until it has native support. Using the\n[polyfill.io](http://polyfill.io) service seems to be the best solution to doing this.\n\n## Setup\nInstall dependencies:\n\n    npm install\n\nRun dev server (run http://localhost:5000)\n\n    npm start\n\nBuild deployment (created in build folder)\n\n    npm run build\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptaincodeman%2Fangular2-webpack-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaptaincodeman%2Fangular2-webpack-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptaincodeman%2Fangular2-webpack-polyfill/lists"}