{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/144","labels_url":"https://api.github.com/repos/webpack/webpack/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/144/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/144/events","html_url":"https://github.com/webpack/webpack/issues/144","id":25389830,"number":144,"title":"Possible to have multiple output files? (i.e. multiple output configs)","user":{"login":"Dashed","id":139499,"avatar_url":"https://avatars.githubusercontent.com/u/139499?v=3","gravatar_id":"","url":"https://api.github.com/users/Dashed","html_url":"https://github.com/Dashed","followers_url":"https://api.github.com/users/Dashed/followers","following_url":"https://api.github.com/users/Dashed/following{/other_user}","gists_url":"https://api.github.com/users/Dashed/gists{/gist_id}","starred_url":"https://api.github.com/users/Dashed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dashed/subscriptions","organizations_url":"https://api.github.com/users/Dashed/orgs","repos_url":"https://api.github.com/users/Dashed/repos","events_url":"https://api.github.com/users/Dashed/events{/privacy}","received_events_url":"https://api.github.com/users/Dashed/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-01-10T11:36:32Z","updated_at":"2015-07-18T10:00:49Z","closed_at":"2014-01-10T11:44:40Z","body":"Is it possible to have multiple files?\r\n\r\nWhat I'm hoping to do is configure `webpack.config.js` to output:\r\n\r\n1. mylibrary.js - non-minified\r\n2. mylibrary.min.js - minified (uglifyjs)\r\n\r\nI looked around the webpack docs to see if this is possible -- but didn't find anything useful.\r\n\r\nIt'll be good to have various output configs."},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/122525590","html_url":"https://github.com/webpack/webpack/issues/144#issuecomment-122525590","issue_url":"https://api.github.com/repos/webpack/webpack/issues/144","id":122525590,"user":{"login":"tuvistavie","id":1436271,"avatar_url":"https://avatars.githubusercontent.com/u/1436271?v=3","gravatar_id":"","url":"https://api.github.com/users/tuvistavie","html_url":"https://github.com/tuvistavie","followers_url":"https://api.github.com/users/tuvistavie/followers","following_url":"https://api.github.com/users/tuvistavie/following{/other_user}","gists_url":"https://api.github.com/users/tuvistavie/gists{/gist_id}","starred_url":"https://api.github.com/users/tuvistavie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuvistavie/subscriptions","organizations_url":"https://api.github.com/users/tuvistavie/orgs","repos_url":"https://api.github.com/users/tuvistavie/repos","events_url":"https://api.github.com/users/tuvistavie/events{/privacy}","received_events_url":"https://api.github.com/users/tuvistavie/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T10:00:49Z","updated_at":"2015-07-18T10:00:49Z","body":"For small builds, I use something like this, it works fine.\r\n\r\nwebpack.config.js :\r\n\r\n```\r\nvar webpack = require('webpack');\r\n\r\nvar env = process.env.WEBPACK_ENV;\r\n\r\nmodule.exports = {\r\n  entry: './src/index.js',\r\n  output: {\r\n    filename: env === 'dist' ? 'app.min.js' : 'app.js',\r\n    path: './dist'\r\n  },\r\n  plugins: env === 'dist' ? [\r\n    new webpack.optimize.UglifyJsPlugin({minimize: true})\r\n  ] : []\r\n};\r\n```\r\n\r\nMakefile:\r\n\r\n```\r\nall: dev dist\r\n\r\ndev:\r\n\twebpack\r\n\r\ndist:\r\n\tWEBPACK_ENV=dist webpack\r\n\r\n.PHONY: dist\r\n```\r\n\r\nFor bigger builds it is probably better to create a file for each environment, or to use another build tool, as mentioned in the other answers."}}