{"action":"created","issue":{"url":"https://api.github.com/repos/developit/preact/issues/4","labels_url":"https://api.github.com/repos/developit/preact/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/developit/preact/issues/4/comments","events_url":"https://api.github.com/repos/developit/preact/issues/4/events","html_url":"https://github.com/developit/preact/pull/4","id":120055650,"number":4,"title":"Suggest changes to how module is published","user":{"login":"sheepsteak","id":1379888,"avatar_url":"https://avatars.githubusercontent.com/u/1379888?v=3","gravatar_id":"","url":"https://api.github.com/users/sheepsteak","html_url":"https://github.com/sheepsteak","followers_url":"https://api.github.com/users/sheepsteak/followers","following_url":"https://api.github.com/users/sheepsteak/following{/other_user}","gists_url":"https://api.github.com/users/sheepsteak/gists{/gist_id}","starred_url":"https://api.github.com/users/sheepsteak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheepsteak/subscriptions","organizations_url":"https://api.github.com/users/sheepsteak/orgs","repos_url":"https://api.github.com/users/sheepsteak/repos","events_url":"https://api.github.com/users/sheepsteak/events{/privacy}","received_events_url":"https://api.github.com/users/sheepsteak/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/developit/preact/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-02T23:01:31Z","updated_at":"2015-12-03T13:32:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/developit/preact/pulls/4","html_url":"https://github.com/developit/preact/pull/4","diff_url":"https://github.com/developit/preact/pull/4.diff","patch_url":"https://github.com/developit/preact/pull/4.patch"},"body":"Apologies if this isn't what you want at all but I thought I'd try and tackle #3. Once I started I realised it might be useful to change how the module is delivered to npm, in a way similar to React itself:\r\n\r\n* A normal version straight from Babel is now given when `require('preact')` is used (from the `lib` directory) for development. It will also be multiple files in `lib` after #3 is done.\r\n* A single file UMD version (`preact.js`), source map (`preact.js.map`) and a single file UMD minified version (`preact.min.js`) is available in `dist`. It's also pushed to npm so that it's possible to do `require('preact/dist/preact.min')` when in production mode."},"comment":{"url":"https://api.github.com/repos/developit/preact/issues/comments/161641015","html_url":"https://github.com/developit/preact/pull/4#issuecomment-161641015","issue_url":"https://api.github.com/repos/developit/preact/issues/4","id":161641015,"user":{"login":"developit","id":105127,"avatar_url":"https://avatars.githubusercontent.com/u/105127?v=3","gravatar_id":"","url":"https://api.github.com/users/developit","html_url":"https://github.com/developit","followers_url":"https://api.github.com/users/developit/followers","following_url":"https://api.github.com/users/developit/following{/other_user}","gists_url":"https://api.github.com/users/developit/gists{/gist_id}","starred_url":"https://api.github.com/users/developit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/developit/subscriptions","organizations_url":"https://api.github.com/users/developit/orgs","repos_url":"https://api.github.com/users/developit/repos","events_url":"https://api.github.com/users/developit/events{/privacy}","received_events_url":"https://api.github.com/users/developit/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T13:32:37Z","updated_at":"2015-12-03T13:32:37Z","body":"Found the setup I mentioned. Seems like it would work:\r\n\r\n```js\r\n{\r\n  \"name\": \"preact\",\r\n  \"amdName\": \"preact\",\r\n  \"version\": \"3.0.0\",\r\n  \"main\": \"dist/preact.js\",\r\n  \"jsnext:main\": \"src/index.js\",\r\n  \"minified:main\": \"dist/preact.min.js\",\r\n  \"scripts\": {\r\n    \"build\": \"npm-run-all rollup minify size docs\",\r\n    \"rollup\": \"rollup -c rollup.config.js -m -f umd -n $npm_package_amdName src/index.js -o $npm_package_main\",\r\n    \"minify\": \"uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map\",\r\n\t\"size\": \"size=$(gzip-size $npm_package_main) && echo \\\"gzip size: $size / $(pretty-bytes $size)\\\"\",\r\n    \"release\": \"npm run build -s && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"babel-core\": \"^5.8.30\",\r\n    \"gzip-size-cli\": \"^1.0.0\",\r\n    \"pretty-bytes\": \"^2.0.1\",\r\n    \"rollup\": \"^0.20.2\",\r\n    \"rollup-plugin-babel\": \"^1.0.0\",\r\n    \"uglify-js\": \"^2.5.0\"\r\n  }\r\n}\r\n```\r\n\r\nI agree regarding not shipping a minified build as the default.  I also wonder if there is really a reason to ship a UMD build by default, since NPM is technically for commonjs.  It would actually be nice to ship the comments-removed babel build with an inline sourcemap, since that's the only thing Webpack supports out-of-the-box using [source-map-loader](https://github.com/webpack/source-map-loader).  Seem decent enough?"}}