{"action":"created","issue":{"url":"https://api.github.com/repos/substack/node-browserify/issues/1065","labels_url":"https://api.github.com/repos/substack/node-browserify/issues/1065/labels{/name}","comments_url":"https://api.github.com/repos/substack/node-browserify/issues/1065/comments","events_url":"https://api.github.com/repos/substack/node-browserify/issues/1065/events","html_url":"https://github.com/substack/node-browserify/issues/1065","id":53949251,"number":1065,"title":"browser wildcards","user":{"login":"justinbmeyer","id":78602,"avatar_url":"https://avatars.githubusercontent.com/u/78602?v=3","gravatar_id":"","url":"https://api.github.com/users/justinbmeyer","html_url":"https://github.com/justinbmeyer","followers_url":"https://api.github.com/users/justinbmeyer/followers","following_url":"https://api.github.com/users/justinbmeyer/following{/other_user}","gists_url":"https://api.github.com/users/justinbmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/justinbmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinbmeyer/subscriptions","organizations_url":"https://api.github.com/users/justinbmeyer/orgs","repos_url":"https://api.github.com/users/justinbmeyer/repos","events_url":"https://api.github.com/users/justinbmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/justinbmeyer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-10T06:50:22Z","updated_at":"2015-01-10T16:31:15Z","closed_at":null,"body":"Would you consider adding browser support for mapping folders.  It could work similar to wildcards in RequireJS's map:\r\n\r\nFor example:\r\n\r\n```js\r\n{\r\n  browser: {\r\n    \"node/*\" : \"browser/*\"\r\n  }\r\n}\r\n```\r\n\r\nThis would make every module request within the `node` folder be mapped to the `browser/` folder.\r\n\r\nThis would be very nice for \"frameworks\", authored in AMD, that would like to be CJS required like:\r\n\r\n```js\r\nvar Control = require(\"can/control\"),\r\n  Component = require(\"can/component\")\r\n```\r\n\r\nAnd have a commonjs build in a `dist` folder.  Browser could support the following:\r\n\r\n```js\r\n{\r\n  browser: {\r\n    \"*\" : \"dist/cjs/*\"\r\n  }\r\n}\r\n```\r\n\r\n\r\nThanks for your consideration.  I'm happy to implement this if you like it."},"comment":{"url":"https://api.github.com/repos/substack/node-browserify/issues/comments/69461709","html_url":"https://github.com/substack/node-browserify/issues/1065#issuecomment-69461709","issue_url":"https://api.github.com/repos/substack/node-browserify/issues/1065","id":69461709,"user":{"login":"justinbmeyer","id":78602,"avatar_url":"https://avatars.githubusercontent.com/u/78602?v=3","gravatar_id":"","url":"https://api.github.com/users/justinbmeyer","html_url":"https://github.com/justinbmeyer","followers_url":"https://api.github.com/users/justinbmeyer/followers","following_url":"https://api.github.com/users/justinbmeyer/following{/other_user}","gists_url":"https://api.github.com/users/justinbmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/justinbmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinbmeyer/subscriptions","organizations_url":"https://api.github.com/users/justinbmeyer/orgs","repos_url":"https://api.github.com/users/justinbmeyer/repos","events_url":"https://api.github.com/users/justinbmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/justinbmeyer/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T16:31:15Z","updated_at":"2015-01-10T16:31:15Z","body":"I also just noticed that a `browser` field like:\r\n\r\n```js\r\nbrowser: {\r\n  \"./control\": \"./dist/cjs/control\"\r\n}\r\n```\r\n\r\ndoesn't seem to be able to map something like:\r\n\r\n```js\r\nrequire(\"can/control\") //-> to can/dist/cjs/control\r\n```\r\n\r\nIs there a way to make something like this work?\r\n\r\n"}}