{"action":"created","issue":{"url":"https://api.github.com/repos/rollup/rollup/issues/855","repository_url":"https://api.github.com/repos/rollup/rollup","labels_url":"https://api.github.com/repos/rollup/rollup/issues/855/labels{/name}","comments_url":"https://api.github.com/repos/rollup/rollup/issues/855/comments","events_url":"https://api.github.com/repos/rollup/rollup/issues/855/events","html_url":"https://github.com/rollup/rollup/issues/855","id":171286763,"number":855,"title":"Migrating react app from webpack to rollup","user":{"login":"VladShcherbin","id":6711845,"avatar_url":"https://avatars.githubusercontent.com/u/6711845?v=3","gravatar_id":"","url":"https://api.github.com/users/VladShcherbin","html_url":"https://github.com/VladShcherbin","followers_url":"https://api.github.com/users/VladShcherbin/followers","following_url":"https://api.github.com/users/VladShcherbin/following{/other_user}","gists_url":"https://api.github.com/users/VladShcherbin/gists{/gist_id}","starred_url":"https://api.github.com/users/VladShcherbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VladShcherbin/subscriptions","organizations_url":"https://api.github.com/users/VladShcherbin/orgs","repos_url":"https://api.github.com/users/VladShcherbin/repos","events_url":"https://api.github.com/users/VladShcherbin/events{/privacy}","received_events_url":"https://api.github.com/users/VladShcherbin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-08-15T23:37:49Z","updated_at":"2016-08-21T21:05:28Z","closed_at":null,"body":"I would like to give rollup a try with production build to see the difference from webpack, but have some issues.\r\n\r\n_It is actually hard to find all needed stuff piece by piece from google, issues, docs, etc._\r\n\r\nOkay, my webpack config is simple:\r\n\r\n```js\r\nconst webpack = require('webpack')\r\n\r\nmodule.exports = {\r\n  devtool: 'hidden-source-map',\r\n  entry: './example',\r\n  output: {\r\n    path: `${__dirname}/example`,\r\n    filename: 'bundle.js'\r\n  },\r\n  module: {\r\n    loaders: [\r\n      {\r\n        test: /\\.js$/,\r\n        exclude: /node_modules/,\r\n        loader: 'babel'\r\n      }\r\n    ]\r\n  },\r\n  plugins: [\r\n    new webpack.DefinePlugin({\r\n      'process.env.NODE_ENV': JSON.stringify('production')\r\n    }),\r\n    new webpack.optimize.UglifyJsPlugin({\r\n      compress: {\r\n        screw_ie8: true,\r\n        warnings: false\r\n      },\r\n      output: {\r\n        comments: false\r\n      },\r\n      sourceMap: false\r\n    })\r\n  ]\r\n}\r\n```\r\n\r\nNow, the rollup:\r\n\r\n```js\r\nimport babel from 'rollup-plugin-babel'\r\nimport commonjs from 'rollup-plugin-commonjs'\r\nimport nodeResolve from 'rollup-plugin-node-resolve'\r\nimport uglify from 'rollup-plugin-uglify'\r\nimport replace from 'rollup-plugin-replace'\r\n\r\nexport default {\r\n  entry: 'example/index.js',\r\n  dest: 'example/rollup-bundle.js',\r\n  format: 'iife',\r\n  plugins: [\r\n    babel({\r\n      exclude: 'node_modules/**'\r\n    }),\r\n    nodeResolve({\r\n      jsnext: true\r\n    }),\r\n    commonjs({\r\n      include: 'node_modules/**'\r\n    }),\r\n    replace({\r\n      'process.env.NODE_ENV': JSON.stringify('production')\r\n    }),\r\n    uglify({\r\n      compress: {\r\n        screw_ie8: true,\r\n        warnings: false\r\n      },\r\n      output: {\r\n        comments: false\r\n      },\r\n      sourceMap: false\r\n    })\r\n  ]\r\n}\r\n```\r\n\r\nBabel:\r\n\r\n```js\r\n{\r\n  \"presets\": [\"react\", \"stage-2\", \"es2015-rollup\"]\r\n}\r\n```\r\n\r\nSimple test:\r\n\r\n```jsx\r\nimport React from 'react'\r\nimport ReactDOM from 'react-dom'\r\n\r\nReactDOM.render(\r\n  <p>Hey</p>,\r\n  document.getElementById('app')\r\n)\r\n```\r\n\r\nIt works, but webpack bundle size is 146 kb, rollup is 156 kb. I expected rollup to be smaller. Why is that ? I also tried `uglify({}, minify)` from harmony branch - same result, no changes at all.\r\n\r\nNow, I try to import router stuff:\r\n\r\n```jsx\r\nimport { Link } from 'react-router'\r\n```\r\n\r\nand have an error:\r\n\r\n```sh\r\nModule .../node_modules/react/react.js does not export PropTypes (imported by .../node_modules/react-router/es/InternalPropTypes.js)\r\n```\r\n\r\nMaybe I missed something in the config?"},"comment":{"url":"https://api.github.com/repos/rollup/rollup/issues/comments/241282056","html_url":"https://github.com/rollup/rollup/issues/855#issuecomment-241282056","issue_url":"https://api.github.com/repos/rollup/rollup/issues/855","id":241282056,"user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2016-08-21T21:05:28Z","updated_at":"2016-08-21T21:05:28Z","body":"It's also quite possible that the number of modules in this project is low enough (and not enough of them are ES6 modules vs CommonJS) that you're not seeing a big gain from Rollup's optimizations. Using `browserify-count-modules` (and `browserify -t babelify` to build), I only count 227 total modules."}}
{"actor":{"display_login":"nolanlawson"}}