{"id":15217927,"url":"https://github.com/lifeart/ember-cli-fallback-builds","last_synced_at":"2025-10-30T04:31:21.038Z","repository":{"id":35008334,"uuid":"196062892","full_name":"lifeart/ember-cli-fallback-builds","owner":"lifeart","description":"Modern/Legacy browsers support, having different js files","archived":false,"fork":false,"pushed_at":"2022-12-10T21:53:18.000Z","size":2511,"stargazers_count":23,"open_issues_count":23,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T06:31:37.408Z","etag":null,"topics":["ember-addon","ember-cli","emberjs","modern-browsers"],"latest_commit_sha":null,"homepage":null,"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/lifeart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-09T18:33:48.000Z","updated_at":"2024-02-10T18:29:16.000Z","dependencies_parsed_at":"2023-01-15T12:00:37.445Z","dependency_job_id":null,"html_url":"https://github.com/lifeart/ember-cli-fallback-builds","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/lifeart%2Fember-cli-fallback-builds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fember-cli-fallback-builds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fember-cli-fallback-builds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lifeart%2Fember-cli-fallback-builds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lifeart","download_url":"https://codeload.github.com/lifeart/ember-cli-fallback-builds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238934083,"owners_count":19554788,"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":["ember-addon","ember-cli","emberjs","modern-browsers"],"created_at":"2024-09-28T12:08:07.901Z","updated_at":"2025-10-30T04:31:20.650Z","avatar_url":"https://github.com/lifeart.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ember-cli-fallback-builds\n==============================================================================\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/lifeart/ember-cli-fallback-builds.svg)](https://greenkeeper.io/)\n\nThis addon allow to have 2 builds (bundles) (for modern and legacy browsers) in one time.\n\n(module, nomodule)\n\n[Modern Script Loading](https://jasonformat.com/modern-script-loading/)\n\n[Pre-RFC: Generate and serve ES2015 assets](https://github.com/emberjs/rfcs/issues/383)\n\nAlternatives: \n* [ember-cli-babel-polyfills](https://github.com/pzuraq/ember-cli-babel-polyfills) [difference](https://github.com/lifeart/ember-cli-fallback-builds/issues/3)\n\nCompatibility\n------------------------------------------------------------------------------\n\n* Ember.js v2.18 or above\n* Ember CLI v2.13 or above\n* Node.js v8 or above\n\n\nInstallation\n------------------------------------------------------------------------------\n\n```\nember install ember-cli-fallback-builds\n```\n\nUsage\n------------------------------------------------------------------------------\n\n\nConfigure your `config/targets.js`:\n```\nprocess.env.BUILD_TARGET = LEGACY | MODERN\n```\n\nExample:\n\n`config/targets.js`\n```js\nconst browsers = [\n  'last 1 Chrome versions'\n];\n\nconst isFallback = process.env.BUILD_TARGET === 'LEGACY';\n\nif (isFallback) {\n  browsers.push('ie 11');\n}\n\nmodule.exports = {\n  browsers\n};\n```\n\nrun:\n```\nember build:fallback --prod\n```\n\ncheck `index.html`\n\n`dist/index.html` before:\n\n```html\n\u003cbody\u003e\n    \u003cscript src=\"/assets/vendor.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/assets/dummy.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\nafter:\n\n```html\n\u003cbody\u003e\n    \u003cscript src=\"/assets/vendor.js\" type=\"module\"\u003e\u003c/script\u003e\n    \u003cscript src=\"/assets/dummy.js\" type=\"module\"\u003e\u003c/script\u003e\n\n    \u003cscript src=\"/assets/vendor.fb.js\" nomodule\u003e\u003c/script\u003e\n    \u003cscript src=\"/assets/dummy.fb.js\" nomodule\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\nnew files: `vendor.fb.js`, `dummy.fb.js` - legacy js bundles (for older browsers)\n\nmodern browser will load `script[type=\"module\"]`, older - `script[nomodule]`\n\ndone!\n\n\nContributing\n------------------------------------------------------------------------------\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n\nLicense\n------------------------------------------------------------------------------\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeart%2Fember-cli-fallback-builds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flifeart%2Fember-cli-fallback-builds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flifeart%2Fember-cli-fallback-builds/lists"}