{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue-cli/issues/2921","repository_url":"https://api.github.com/repos/vuejs/vue-cli","labels_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2921/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2921/comments","events_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2921/events","html_url":"https://github.com/vuejs/vue-cli/issues/2921","id":378693950,"node_id":"MDU6SXNzdWUzNzg2OTM5NTA=","number":2921,"title":"A way to detect modern/legacy build","user":{"login":"Djaler","id":7964583,"node_id":"MDQ6VXNlcjc5NjQ1ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/7964583?v=4","gravatar_id":"","url":"https://api.github.com/users/Djaler","html_url":"https://github.com/Djaler","followers_url":"https://api.github.com/users/Djaler/followers","following_url":"https://api.github.com/users/Djaler/following{/other_user}","gists_url":"https://api.github.com/users/Djaler/gists{/gist_id}","starred_url":"https://api.github.com/users/Djaler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Djaler/subscriptions","organizations_url":"https://api.github.com/users/Djaler/orgs","repos_url":"https://api.github.com/users/Djaler/repos","events_url":"https://api.github.com/users/Djaler/events{/privacy}","received_events_url":"https://api.github.com/users/Djaler/received_events","type":"User","site_admin":false},"labels":[{"id":541724845,"node_id":"MDU6TGFiZWw1NDE3MjQ4NDU=","url":"https://api.github.com/repos/vuejs/vue-cli/labels/feature%20request","name":"feature request","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-11-08T11:39:27Z","updated_at":"2018-11-09T06:32:18Z","closed_at":null,"author_association":"NONE","body":"### What problem does this feature solve?\r\nI use css variables in my application. But they are not supported in old browsers. Because of this I need to use [css-vars-ponyfill](https://github.com/jhildenbiddle/css-vars-ponyfill). But call to this library is necessary only in old browsers. And because of this I need a way to detect modern/legacy build to include this code only in legacy build.\r\n\r\n### What does the proposed API look like?\r\nI think, information about current build type could be accessed via `process.env` variable.\r\nFor example: `process.env.IS_MODERN_BUILD`\r\n\r\n<!-- generated by vue-issues. DO NOT REMOVE -->"},"comment":{"url":"https://api.github.com/repos/vuejs/vue-cli/issues/comments/437264271","html_url":"https://github.com/vuejs/vue-cli/issues/2921#issuecomment-437264271","issue_url":"https://api.github.com/repos/vuejs/vue-cli/issues/2921","id":437264271,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzI2NDI3MQ==","user":{"login":"Djaler","id":7964583,"node_id":"MDQ6VXNlcjc5NjQ1ODM=","avatar_url":"https://avatars0.githubusercontent.com/u/7964583?v=4","gravatar_id":"","url":"https://api.github.com/users/Djaler","html_url":"https://github.com/Djaler","followers_url":"https://api.github.com/users/Djaler/followers","following_url":"https://api.github.com/users/Djaler/following{/other_user}","gists_url":"https://api.github.com/users/Djaler/gists{/gist_id}","starred_url":"https://api.github.com/users/Djaler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Djaler/subscriptions","organizations_url":"https://api.github.com/users/Djaler/orgs","repos_url":"https://api.github.com/users/Djaler/repos","events_url":"https://api.github.com/users/Djaler/events{/privacy}","received_events_url":"https://api.github.com/users/Djaler/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T06:32:18Z","updated_at":"2018-11-09T06:32:18Z","author_association":"NONE","body":"@sodatea thank you! This works as expected.\r\nCan you also help me yet another time? Why this doesn't work?\r\n```\r\n// vue.config.js\r\nmodule.exports = {\r\n  configureWebpack: {\r\n    plugins: [\r\n      new webpack.DefinePlugin({\r\n        'process.env': {\r\n          'IS_MODERN_BUILD': process.env.VUE_CLI_MODERN_BUILD,\r\n        },\r\n      }),\r\n    ]\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"Djaler"}}