{"id":13807037,"url":"https://github.com/ef4/ember-browserify","last_synced_at":"2025-04-04T15:07:48.307Z","repository":{"id":23295764,"uuid":"26654982","full_name":"ef4/ember-browserify","owner":"ef4","description":"ember-cli addon for easily loading CommonJS packages from npm via browserify.","archived":false,"fork":false,"pushed_at":"2021-10-04T08:48:53.000Z","size":189,"stargazers_count":172,"open_issues_count":18,"forks_count":28,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T19:43:23.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ciaoca/cxSelect","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ef4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-14T19:55:01.000Z","updated_at":"2023-08-24T21:49:37.000Z","dependencies_parsed_at":"2022-08-01T11:37:28.225Z","dependency_job_id":null,"html_url":"https://github.com/ef4/ember-browserify","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/ef4%2Fember-browserify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef4%2Fember-browserify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef4%2Fember-browserify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ef4%2Fember-browserify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ef4","download_url":"https://codeload.github.com/ef4/ember-browserify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198450,"owners_count":20900080,"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-08-04T01:01:19.880Z","updated_at":"2025-04-04T15:07:48.290Z","avatar_url":"https://github.com/ef4.png","language":"JavaScript","readme":"# DEPRECATION WARNING\n\nember-browserify is deprecated in favor of https://github.com/ef4/ember-auto-import or https://github.com/rwjblue/ember-cli-cjs-transform\n\nIf you still depend on it and want to fix a bug, I will happily merge PRs.\n\n# Ember-browserify [![Build Status](https://travis-ci.org/ef4/ember-browserify.svg)](https://travis-ci.org/ef4/ember-browserify) [![Build status](https://ci.appveyor.com/api/projects/status/v6dtl3y0vxcskp7g?svg=true)](https://ci.appveyor.com/project/ef4/ember-browserify)\n\n\nThis is an ember-cli addon for easily loading CommonJS modules from\nnpm via browserify.\n\nIt works with ember-cli \u003e= 0.1.3.\n\n## Synopsis\n\nAdd to your ember app:\n\n```sh\nnpm install --save-dev ember-browserify\n```\n\nThen `npm install` any modules you want to load into your Ember app:\n\n```sh\nnpm install --save-dev my-cool-module\n```\n\nThen within your app, you can import the module:\n\n```js\nimport MyCoolModule from \"npm:my-cool-module\";\n```\n\n## Rebuilds \u0026 Caching\n\nWe're careful to only re-invoke browserify when necessary. If your set\nof imported modules remains stable and you aren't editing them,\neverything is served out of cache.\n\nIf you import a new npm module or edit an already-imported one, you\nget automatic rebuilds.\n\n## Configuring Browserify\n\nYou can put a `browserify` key in your app's `config/environment.js`\nto customize the behavior:\n\n```js\nbrowserify: {\n  extensions: ['.coffee'],\n  transform: [\n    ['caching-coffeeify', { global: true }]\n  ]\n}\n```\n\n## Known Caveats\n\nEmber-browserify __cannot__ be used with named imports e.g. `import { foo } from 'bar';` as we have no way of knowing at the time of browserifying what portions of the import are being used.\n\n## Using ember-browserify in addons\n\nWrapping generic npm libraries is a pretty common use case for ember addons. Unfortunately, ember-browserify installed on an addon cannot simply consume an npm dependency for the host app. This is a limitation of ember-cli. More info in [this issue](https://github.com/ef4/ember-browserify/issues/34) and [this issue](https://github.com/ef4/ember-browserify/issues/38). Try it, and you'll probably get this error:\n\n```\nPath or pattern \"browserify/browserify.js\" did not match any files\nError: Path or pattern \"browserify/browserify.js\" did not match any files\n```\n\nOr you might get an error like:\n\n```\nCould not find module `npm:my-module` imported from `my-project/my-file`\n```\n\n#### The workaround\n\nTo have the host app consume the npm dependency, **ember-browserify and the npm dependency must be installed in the host app** as well *AND* the **module must be imported from within the `app/` directory of the addon**. So in your app, simply npm install ember-browserify and whatever npm dependencies you need consumed by ember-browserify. Then in your addon, make sure that you're importing the modules from a file in the `app/` folder. You can also import from the `addon/` directory *IF* you've also imported the same module in the `app/` directory. This is because ember-browserify running under the host application can't detect imports in the `addon/` directory, since the `app/` directory is the only directory merged with the application tree at build.\n\nEventually, ember-cli will be able to directly pull in npm depedencies to an ember app without the need for ember-browserify. Progress on this ember-cli feature can be tracked in [this issue ticket](https://github.com/ember-cli/ember-cli/issues/4211).\n","funding_links":[],"categories":["Packages"],"sub_categories":["Include external JS code"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fef4%2Fember-browserify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fef4%2Fember-browserify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fef4%2Fember-browserify/lists"}