{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/elixir/issues/579","repository_url":"https://api.github.com/repos/laravel/elixir","labels_url":"https://api.github.com/repos/laravel/elixir/issues/579/labels{/name}","comments_url":"https://api.github.com/repos/laravel/elixir/issues/579/comments","events_url":"https://api.github.com/repos/laravel/elixir/issues/579/events","html_url":"https://github.com/laravel/elixir/issues/579","id":164315051,"number":579,"title":"Allow NODE_ENV to be set by --production","user":{"login":"lioannou","id":1210658,"avatar_url":"https://avatars.githubusercontent.com/u/1210658?v=3","gravatar_id":"","url":"https://api.github.com/users/lioannou","html_url":"https://github.com/lioannou","followers_url":"https://api.github.com/users/lioannou/followers","following_url":"https://api.github.com/users/lioannou/following{/other_user}","gists_url":"https://api.github.com/users/lioannou/gists{/gist_id}","starred_url":"https://api.github.com/users/lioannou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lioannou/subscriptions","organizations_url":"https://api.github.com/users/lioannou/orgs","repos_url":"https://api.github.com/users/lioannou/repos","events_url":"https://api.github.com/users/lioannou/events{/privacy}","received_events_url":"https://api.github.com/users/lioannou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-07T13:56:56Z","updated_at":"2016-12-29T18:25:25Z","closed_at":"2016-07-11T19:04:16Z","body":"Hi Jeffrey,\n\nWhen you run `gulp --production` you want the output to be exactly as expected for production.\n\nBut a common issue discussed in many issues such as https://github.com/JeffreyWay/laravel-elixir-vueify/issues/12, https://github.com/JeffreyWay/laravel-elixir-vueify/issues/10, https://github.com/JeffreyWay/laravel-elixir-vueify/issues/7 and mentioned in Vueify docs https://github.com/vuejs/vueify#building-for-production all show confusion with `NODE_ENV`.\n\nA very simple solution is to have Elixir set `NODE_ENV` to `production` when the `--production` flag is used. This ensures that all modules all way through the build process correctly build for production.\n\nI had a look through the /src - and I dont know the \"best/right\" place to configure/insert this code:\n\n```\nif (Elixir.inProduction) {\n    process.env.NODE_ENV = 'production';\n}\n```\n\nThis only sets `NODE_ENV` for that single build process - it is not saved globally.\n\nAnd the code above must run sometime _after_ this has already been set:\n\n```\nElixir.inProduction = gutils.env.production || process.env.NODE_ENV === 'production';\n```\n\nI thought about this been part of the Elixir-Vueify code only - but it would possibly be an overall benefit to the entire Elixir process, to ensure all modules take advantage of a `--production` flag.\n"},"comment":{"url":"https://api.github.com/repos/laravel/elixir/issues/comments/269671392","html_url":"https://github.com/laravel/elixir/issues/579#issuecomment-269671392","issue_url":"https://api.github.com/repos/laravel/elixir/issues/579","id":269671392,"user":{"login":"quiquegarcia","id":286159,"avatar_url":"https://avatars.githubusercontent.com/u/286159?v=3","gravatar_id":"","url":"https://api.github.com/users/quiquegarcia","html_url":"https://github.com/quiquegarcia","followers_url":"https://api.github.com/users/quiquegarcia/followers","following_url":"https://api.github.com/users/quiquegarcia/following{/other_user}","gists_url":"https://api.github.com/users/quiquegarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/quiquegarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quiquegarcia/subscriptions","organizations_url":"https://api.github.com/users/quiquegarcia/orgs","repos_url":"https://api.github.com/users/quiquegarcia/repos","events_url":"https://api.github.com/users/quiquegarcia/events{/privacy}","received_events_url":"https://api.github.com/users/quiquegarcia/received_events","type":"User","site_admin":false},"created_at":"2016-12-29T18:25:25Z","updated_at":"2016-12-29T18:25:25Z","body":"Following the workaround suggested in [this thread](https://laracasts.com/discuss/channels/elixir/disabling-vue-devtools-in-production) vueDevTools is disabled in production, but as @evertramos commented, this would be awesome if is handled automatically running ```gulp --production```"}}
{"actor":{"display_login":"quiquegarcia"}}