{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/118","repository_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin","labels_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/118/comments","events_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/118/events","html_url":"https://github.com/webpack/extract-text-webpack-plugin/issues/118","id":111616776,"number":118,"title":"Plugin removes all .js code from a chunk","user":{"login":"dmitriid","id":32768,"avatar_url":"https://avatars.githubusercontent.com/u/32768?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriid","html_url":"https://github.com/dmitriid","followers_url":"https://api.github.com/users/dmitriid/followers","following_url":"https://api.github.com/users/dmitriid/following{/other_user}","gists_url":"https://api.github.com/users/dmitriid/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriid/subscriptions","organizations_url":"https://api.github.com/users/dmitriid/orgs","repos_url":"https://api.github.com/users/dmitriid/repos","events_url":"https://api.github.com/users/dmitriid/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-10-15T13:29:32Z","updated_at":"2016-06-03T19:49:30Z","closed_at":null,"body":"TL;DR: when generating two .js and one .css chunks the plugin removes all .js code from one of the .js chunks.\r\n\r\nI may be missing something, but I can't find what it is :)\r\n\r\nThe config is as follows:\r\n\r\n```js\r\nvar path = require('path');\r\nvar webpack = require('webpack');\r\nvar ExtractTextPlugin = require(\"extract-text-webpack-plugin\");\r\nvar glob = require(\"glob\");\r\n\r\nmodule.exports = {\r\n    entry: {\r\n        app: [\r\n            './.build/app/app_dependencys.js',\r\n            './.build/app/_helpers/api_helpers.js',\r\n            './.build/app/event-manager.js',\r\n            './.build/app/route_handlers/Router.js'\r\n        ],\r\n        lib: [\r\n            'c3',\r\n            'lodash',\r\n            'moment',\r\n            'moment-timezone',\r\n            'pleasejs',\r\n            'react-bootstrap-datetimepicker',\r\n            'react',\r\n            'react-bootstrap',\r\n            'react-d3-components',\r\n            'react-datepicker-component',\r\n            'react-googlemaps',\r\n            'react-router',\r\n            'react-slider',\r\n            'reactable',\r\n            'select2'\r\n        ],\r\n        css: glob.sync('./css/css/*.styl')\r\n    },\r\n    output: {\r\n        path: path.join(__dirname, 'js/dist'),\r\n        filename: \"app.js\",\r\n        chunkFilename: \"[name].js\"\r\n    },\r\n    module: {\r\n        loaders: [\r\n            {test: /\\.jsx?$/, loader: 'babel?compact=false', ignore: /node_modules/},\r\n            {test: /\\.json$/, loader: \"json\"},\r\n            {\r\n                test: /\\.styl$/,\r\n                loader: ExtractTextPlugin.extract('raw', 'raw!stylus')\r\n            }\r\n        ]\r\n    },\r\n    plugins: [\r\n        new ExtractTextPlugin('id', \"./../../css/compiled/css.css\", {allChunks: false}),\r\n        new webpack.optimize.CommonsChunkPlugin(/* chunkName= */\"lib\", /* filename= */\"lib.js\", Infinity)\r\n    ],\r\n    externals: ['jquery'],\r\n    bail: true\r\n};\r\n```\r\n\r\nWhen running `webpack`, this is the output:\r\n\r\n```\r\nTime: 51884ms\r\n                       Asset     Size  Chunks             Chunk Names\r\n                      app.js   3.8 kB    0, 1  [emitted]  app, css\r\n                      lib.js  3.47 MB       2  [emitted]  lib\r\n./../../css/compiled/css.css   131 kB       1  [emitted]  css\r\n   [0] multi app 64 bytes {0} [built]\r\n   [0] multi css 364 bytes {1} [built]\r\n   [0] multi lib 196 bytes {2} [built]\r\n    + 634 hidden modules\r\nChild extract-text-webpack-plugin:\r\n        + 1 hidden modules\r\nChild extract-text-webpack-plugin:\r\n        + 1 hidden modules\r\nChild extract-text-webpack-plugin:\r\n        + 1 hidden modules\r\n\r\n.... it goes on for a while ...\r\n```\r\n\r\nAs a result:\r\n\r\n- `css.css` contains all css, as required\r\n- `lib.js` contains all lib code, as required\r\n- `app.js`: every single entry in `app.js` is replaced with\r\n```js\r\n/***/ 581:\r\n/***/ function(module, exports) {\r\n\r\n\t// removed by extract-text-webpack-plugin\r\n\r\n/***/ },\r\n\r\n/***/ 582:\r\n/***/ function(module, exports) {\r\n\r\n\t// removed by extract-text-webpack-plugin\r\n\r\n/***/ },\r\n...\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/comments/223677207","html_url":"https://github.com/webpack/extract-text-webpack-plugin/issues/118#issuecomment-223677207","issue_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/118","id":223677207,"user":{"login":"dlebedynskyi","id":1182917,"avatar_url":"https://avatars.githubusercontent.com/u/1182917?v=3","gravatar_id":"","url":"https://api.github.com/users/dlebedynskyi","html_url":"https://github.com/dlebedynskyi","followers_url":"https://api.github.com/users/dlebedynskyi/followers","following_url":"https://api.github.com/users/dlebedynskyi/following{/other_user}","gists_url":"https://api.github.com/users/dlebedynskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/dlebedynskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlebedynskyi/subscriptions","organizations_url":"https://api.github.com/users/dlebedynskyi/orgs","repos_url":"https://api.github.com/users/dlebedynskyi/repos","events_url":"https://api.github.com/users/dlebedynskyi/events{/privacy}","received_events_url":"https://api.github.com/users/dlebedynskyi/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T19:49:30Z","updated_at":"2016-06-03T19:49:30Z","body":"Same problem. any workaround? "}}
{"actor":{"display_login":"dlebedynskyi"}}