{"action":"created","issue":{"url":"https://api.github.com/repos/mui-org/material-ui/issues/12760","repository_url":"https://api.github.com/repos/mui-org/material-ui","labels_url":"https://api.github.com/repos/mui-org/material-ui/issues/12760/labels{/name}","comments_url":"https://api.github.com/repos/mui-org/material-ui/issues/12760/comments","events_url":"https://api.github.com/repos/mui-org/material-ui/issues/12760/events","html_url":"https://github.com/mui-org/material-ui/issues/12760","id":356430991,"node_id":"MDU6SXNzdWUzNTY0MzA5OTE=","number":12760,"title":"Build errors in styles and buttons with babel","user":{"login":"dustingraves","id":6600627,"node_id":"MDQ6VXNlcjY2MDA2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/6600627?v=4","gravatar_id":"","url":"https://api.github.com/users/dustingraves","html_url":"https://github.com/dustingraves","followers_url":"https://api.github.com/users/dustingraves/followers","following_url":"https://api.github.com/users/dustingraves/following{/other_user}","gists_url":"https://api.github.com/users/dustingraves/gists{/gist_id}","starred_url":"https://api.github.com/users/dustingraves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustingraves/subscriptions","organizations_url":"https://api.github.com/users/dustingraves/orgs","repos_url":"https://api.github.com/users/dustingraves/repos","events_url":"https://api.github.com/users/dustingraves/events{/privacy}","received_events_url":"https://api.github.com/users/dustingraves/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-03T09:42:42Z","updated_at":"2018-09-03T09:43:50Z","closed_at":null,"author_association":"NONE","body":"<!--- Provide a general summary of the issue in the Title above -->\r\nI can't run my build in CircleCi as it fails with a bunch of module not found errors.\r\n\r\nI have made attempts to fix based on other issues with adding '@babel/runtime', upgrading react-event-listener etc.\r\n<!--\r\n    Thank you very much for contributing to Material-UI by creating an issue! ❤️\r\n    To avoid duplicate issues we ask you to check off the following list.\r\n-->\r\n\r\n<!-- Checked checkbox should look like this: [x] -->\r\n- [x] This is a v1.x issue. <!-- (v0.x is no longer maintained) -->\r\n- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.\r\n\r\n## Expected Behavior\r\n<!---\r\n    It should build and test.\r\n-->\r\n\r\n## Current Behavior\r\n<!--- -->\r\n    It breaks like so:\r\n\r\n```bash\r\n#!/bin/bash -eo pipefail\r\nnpm test\r\n\r\n> app@0.0.1 test /home/circleci/platform-app\r\n> cross-env NODE_ENV=test karma start build/karma.config\r\n\r\n\r\nSTART:\r\n\r\nERROR in ./node_modules/material-ui/styles/withStyles.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/map' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/withStyles.js 32:34-71\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/styles/transitions.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/number/is-nan' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/transitions.js 14:36-83\r\n @ ./node_modules/material-ui/styles/createMuiTheme.js\r\n @ ./node_modules/material-ui/styles/withStyles.js\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/styles/withStyles.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/number/min-safe-integer' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/withStyles.js 34:45-102\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/get-prototype-of' in '/home/circleci/platform-app/node_modules/material-ui/ButtonBase'\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js 16:45-102\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/get-prototype-of' in '/home/circleci/platform-app/node_modules/material-ui/ButtonBase'\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js 16:45-102\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/ButtonBase/Ripple.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/get-prototype-of' in '/home/circleci/platform-app/node_modules/material-ui/ButtonBase'\r\n @ ./node_modules/material-ui/ButtonBase/Ripple.js 16:45-102\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/styles/withStyles.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/get-prototype-of' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/withStyles.js 18:45-102\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/styles/transitions.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/keys' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/transitions.js 10:35-80\r\n @ ./node_modules/material-ui/styles/createMuiTheme.js\r\n @ ./node_modules/material-ui/styles/withStyles.js\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/styles/withStyles.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/keys' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/withStyles.js 14:35-80\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/styles/getStylesCreator.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/keys' in '/home/circleci/platform-app/node_modules/material-ui/styles'\r\n @ ./node_modules/material-ui/styles/getStylesCreator.js 10:35-80\r\n @ ./node_modules/material-ui/styles/withStyles.js\r\n @ ./node_modules/material-ui/ButtonBase/TouchRipple.js\r\n @ ./node_modules/material-ui/ButtonBase/ButtonBase.js\r\n @ ./node_modules/material-ui/ButtonBase/index.js\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\n\r\nERROR in ./node_modules/material-ui/utils/helpers.js\r\nModule not found: Error: Can't resolve '@babel/runtime/core-js/object/keys' in '/home/circleci/platform-app/node_modules/material-ui/utils'\r\n @ ./node_modules/material-ui/utils/helpers.js 16:35-80\r\n @ ./node_modules/material-ui/Button/Button.js\r\n @ ./node_modules/material-ui/Button/index.js\r\n @ ./src/routes/Events/routes/Event/components/RegisterdialogForm/RegisterdialogForm.js\r\n @ ./src \\.(js)$\r\n @ ./tests/test-bundler.js\r\nPhantomJS 2.1.1 (Linux 0.0.0) ERROR\r\n  {\r\n    \"message\": \"Error: Cannot find module \\\"@babel/runtime/core-js/object/keys\\\"\\nat webpack:///node_modules/material-ui/styles/withStyles.js:14 <- tests/test-bundler.js:35578:208\",\r\n    \"str\": \"Error: Cannot find module \\\"@babel/runtime/core-js/object/keys\\\"\\nat webpack:///node_modules/material-ui/styles/withStyles.js:14 <- tests/test-bundler.js:35578:208\"\r\n  }\r\nPhantomJS 2.1.1 (Linux 0.0.0) ERROR\r\n  {\r\n    \"message\": \"Error: Cannot find module \\\"@babel/runtime/core-js/object/keys\\\"\\nat webpack:///node_modules/material-ui/styles/withStyles.js:14 <- tests/test-bundler.js:35578:208\",\r\n    \"str\": \"Error: Cannot find module \\\"@babel/runtime/core-js/object/keys\\\"\\nat webpack:///node_modules/material-ui/styles/withStyles.js:14 <- tests/test-bundler.js:35578:208\"\r\n  }\r\n```\r\n\r\n\r\n## Steps to Reproduce\r\n<!---\r\n    Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug.\r\n    Include code to reproduce, if relevant (which it most likely is).\r\n\r\n    This codesandbox.io template _may_ be a good starting point:\r\n    https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/create-react-app\r\n\r\n    If you're using typescript a better starting point would be\r\n    https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/create-react-app-with-typescript\r\n\r\n    If YOU DO NOT take time to provide a codesandbox.io reproduction, should the COMMUNITY take time to help you?\r\n\r\n-->\r\nI am not sure I can replicate as it happens on build in the command line\r\n\r\nLink:\r\n\r\n1. npm install\r\n2. npm test (karma, webpack)\r\nIt fails after this because of newer changes in material-ui and babel\r\n\r\n## Context\r\n<!---\r\n    What are you trying to accomplish? How has this issue affected you?\r\n    Providing context helps us come up with a solution that is most useful in the real world.\r\n-->\r\nI am trying to build and deploy from our CI environment.\r\n## Your Environment\r\n<!---\r\n    Include as many relevant details about the environment with which you experienced the bug.\r\n    If you encounter issues with typescript please include version and tsconfig.\r\n-->\r\n\r\n| Tech         | Version |\r\n|--------------|---------|\r\n| Material-UI  | v1.5.1 && v3.0.1  |\r\n| React        |     \"^16.4.1\",    |\r\n| Browser      |         |\r\n| TypeScript   |         |\r\n| etc.         |         |\r\n\r\n```js\r\n  \"dependencies\": {\r\n    \"@babel/runtime\": \"^7.0.0\",\r\n    \"@material-ui/core\": \"^3.0.1\",\r\n    \"@material-ui/icons\": \"^3.0.1\",\r\n    \"@types/googlemaps\": \"^3.30.11\",\r\n    \"@types/markerclustererplus\": \"^2.1.33\",\r\n    \"babel-polyfill\": \"^6.26.0\",\r\n    \"color-string\": \"^1.5.2\",\r\n    \"firebase\": \"^5.0.4\",\r\n    \"is-hex\": \"^1.1.3\",\r\n    \"lodash\": \"^4.17.10\",\r\n    \"material-icons\": \"^0.2.3\",\r\n    \"material-ui-image\": \"^3.0.0-pre.7\",\r\n    \"material-ui-next-community-icons\": \"^1.0.0\",\r\n    \"material-ui-pickers\": \"^1.0.0-rc.14\",\r\n    \"moment\": \"^2.22.2\",\r\n    \"moment-timezone\": \"^0.5.18\",\r\n    \"mui-datatables\": \"^2.0.0-beta-22\",\r\n    \"normalize.css\": \"^7.0.0\",\r\n    \"object-assign\": \"^4.1.1\",\r\n    \"promise\": \"^7.1.1\",\r\n    \"prop-types\": \"^15.6.1\",\r\n    \"react\": \"^16.4.1\",\r\n    \"react-aspect-ratio\": \"^1.0.31\",\r\n    \"react-circular-progressbar\": \"^0.8.0\",\r\n    \"react-csv\": \"^1.0.15-RC2\",\r\n    \"react-dom\": \"^16.4.1\",\r\n    \"react-dropzone\": \"^4.2.13\",\r\n    \"react-event-listener\": \"^0.6.3\",\r\n    \"react-ga\": \"^2.5.3\",\r\n    \"react-google-button\": \"^0.3.0\",\r\n    \"react-google-charts\": \"^1.6.0\",\r\n    \"react-google-maps\": \"^9.4.5\",\r\n    \"react-lines-ellipsis\": \"^0.13.2\",\r\n    \"react-redux\": \"^5.0.7\",\r\n    \"react-redux-firebase\": \"^2.1.6\",\r\n    \"react-router\": \"^3.0.0\",\r\n    \"react-stripe-elements\": \"^2.0.0\",\r\n    \"recharts\": \"^1.0.0-beta.10\",\r\n    \"recompose\": \"^0.27.1\",\r\n    \"redbox-react\": \"^1.6.0\",\r\n    \"redux\": \"^4.0.0\",\r\n    \"redux-auth-wrapper\": \"^1.0.0\",\r\n    \"redux-firestore\": \"^0.5.7\",\r\n    \"redux-form\": \"^7.4.0\",\r\n    \"redux-form-material-ui\": \"^5.0.0-beta.3\",\r\n    \"redux-thunk\": \"^2.3.0\",\r\n    \"rgb-color\": \"^2.1.2\",\r\n    \"stackdriver-errors-js\": \"^0.4.0\",\r\n    \"uuid\": \"^3.2.1\",\r\n    \"whatwg-fetch\": \"^2.0.4\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"babel-cli\": \"^6.26.0\",\r\n    \"babel-core\": \"^6.26.3\",\r\n    \"babel-eslint\": \"^7.2.3\",\r\n    \"babel-loader\": \"^7.1.4\",\r\n    \"babel-plugin-lodash\": \"^3.3.4\",\r\n    \"babel-plugin-syntax-dynamic-import\": \"^6.18.0\",\r\n    \"babel-plugin-transform-class-properties\": \"^6.24.1\",\r\n    \"babel-plugin-transform-decorators-legacy\": \"^1.3.5\",\r\n    \"babel-plugin-transform-export-extensions\": \"^6.22.0\",\r\n    \"babel-plugin-transform-object-rest-spread\": \"^6.23.0\",\r\n    \"babel-plugin-transform-runtime\": \"^6.23.0\",\r\n    \"babel-preset-env\": \"^1.7.0\",\r\n    \"babel-preset-react\": \"^6.24.1\",\r\n    \"chai\": \"^3.5.0\",\r\n    \"chai-as-promised\": \"^6.0.0\",\r\n    \"chai-enzyme\": \"^1.0.0-beta.0\",\r\n    \"chalk\": \"^1.1.3\",\r\n    \"cheerio\": \"0.22.0\",\r\n    \"codecov\": \"^3.0.2\",\r\n    \"compression\": \"^1.6.2\",\r\n    \"connect-history-api-fallback\": \"^1.3.0\",\r\n    \"cross-env\": \"^5.2.0\",\r\n    \"css-loader\": \"^0.28.11\",\r\n    \"debug\": \"^3.1.0\",\r\n    \"dirty-chai\": \"^1.2.2\",\r\n    \"enzyme\": \"^3.3.0\",\r\n    \"enzyme-adapter-react-16\": \"^1.1.1\",\r\n    \"eslint\": \"^3.19.0\",\r\n    \"eslint-config-prettier\": \"^2.9.0\",\r\n    \"eslint-config-standard\": \"^10.2.1\",\r\n    \"eslint-config-standard-react\": \"^5.0.0\",\r\n    \"eslint-plugin-babel\": \"^4.1.1\",\r\n    \"eslint-plugin-import\": \"^2.12.0\",\r\n    \"eslint-plugin-node\": \"^4.2.2\",\r\n    \"eslint-plugin-prettier\": \"^2.6.0\",\r\n    \"eslint-plugin-promise\": \"^3.8.0\",\r\n    \"eslint-plugin-react\": \"^7.9.1\",\r\n    \"eslint-plugin-standard\": \"^3.1.0\",\r\n    \"express\": \"^4.14.0\",\r\n    \"extract-text-webpack-plugin\": \"^3.0.0\",\r\n    \"favicons-webpack-plugin\": \"0.0.9\",\r\n    \"figures\": \"^2.0.0\",\r\n    \"file-loader\": \"^0.11.1\",\r\n    \"firebase-ci\": \"^0.4.6\",\r\n    \"firebase-tools\": \"^3.18.6\",\r\n    \"fs-extra\": \"^3.0.1\",\r\n    \"html-webpack-plugin\": \"^2.29.0\",\r\n    \"husky\": \"^0.14.3\",\r\n    \"ip\": \"^1.1.5\",\r\n    \"istanbul-instrumenter-loader\": \"^3.0.1\",\r\n    \"karma\": \"^2.0.2\",\r\n    \"karma-coverage-istanbul-reporter\": \"^1.4.3\",\r\n    \"karma-mocha\": \"^1.3.0\",\r\n    \"karma-mocha-reporter\": \"^2.2.1\",\r\n    \"karma-phantomjs-launcher\": \"^1.0.4\",\r\n    \"karma-webpack-with-fast-source-maps\": \"^1.10.0\",\r\n    \"mocha\": \"^5.2.0\",\r\n    \"node-sass\": \"^4.9.0\",\r\n    \"phantomjs-prebuilt\": \"^2.1.16\",\r\n    \"prettier\": \"^1.13.5\",\r\n    \"react-test-renderer\": \"^16.4.1\",\r\n    \"rimraf\": \"^2.6.1\",\r\n    \"sass-loader\": \"^6.0.7\",\r\n    \"sinon\": \"^2.2.0\",\r\n    \"sinon-chai\": \"^2.10.0\",\r\n    \"style-loader\": \"^0.17.0\",\r\n    \"url-loader\": \"^1.0.1\",\r\n    \"webpack\": \"^3.12.0\",\r\n    \"webpack-dashboard\": \"^2.0.0\",\r\n    \"webpack-dev-middleware\": \"^1.11.0\",\r\n    \"webpack-hot-middleware\": \"^2.22.2\",\r\n    \"yargs\": \"^8.0.1\"\r\n  }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mui-org/material-ui/issues/comments/418061236","html_url":"https://github.com/mui-org/material-ui/issues/12760#issuecomment-418061236","issue_url":"https://api.github.com/repos/mui-org/material-ui/issues/12760","id":418061236,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODA2MTIzNg==","user":{"login":"dustingraves","id":6600627,"node_id":"MDQ6VXNlcjY2MDA2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/6600627?v=4","gravatar_id":"","url":"https://api.github.com/users/dustingraves","html_url":"https://github.com/dustingraves","followers_url":"https://api.github.com/users/dustingraves/followers","following_url":"https://api.github.com/users/dustingraves/following{/other_user}","gists_url":"https://api.github.com/users/dustingraves/gists{/gist_id}","starred_url":"https://api.github.com/users/dustingraves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustingraves/subscriptions","organizations_url":"https://api.github.com/users/dustingraves/orgs","repos_url":"https://api.github.com/users/dustingraves/repos","events_url":"https://api.github.com/users/dustingraves/events{/privacy}","received_events_url":"https://api.github.com/users/dustingraves/received_events","type":"User","site_admin":false},"created_at":"2018-09-03T09:43:50Z","updated_at":"2018-09-03T09:43:50Z","author_association":"NONE","body":"Webpack\r\n\r\n```js\r\nconst path = require('path')\r\nconst webpack = require('webpack')\r\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\r\nconst ExtractTextPlugin = require('extract-text-webpack-plugin')\r\nconst FaviconsWebpackPlugin = require('favicons-webpack-plugin')\r\nconst project = require('../project.config')\r\n\r\nconst inProject = path.resolve.bind(path, project.basePath)\r\nconst inProjectSrc = file => inProject(project.srcDir, file)\r\n\r\nconst __DEV__ = project.env === 'development'\r\nconst __TEST__ = project.env === 'test'\r\nconst __PROD__ = project.env === 'production'\r\n\r\nconst config = {\r\n  entry: {\r\n    normalize: [inProjectSrc('normalize')],\r\n    main: [inProjectSrc(project.main)],\r\n  },\r\n  devtool: project.sourcemaps ? 'source-map' : false,\r\n  output: {\r\n    path: inProject(project.outDir),\r\n    filename: __DEV__ ? '[name].js' : '[name].[chunkhash].js',\r\n    publicPath: project.publicPath,\r\n  },\r\n  resolve: {\r\n    modules: [inProject(project.srcDir), 'node_modules'],\r\n    extensions: ['*', '.js', '.jsx', '.json'],\r\n  },\r\n  externals: project.externals,\r\n  module: {\r\n    rules: [],\r\n  },\r\n  plugins: [\r\n    new webpack.DefinePlugin(\r\n      Object.assign(\r\n        {\r\n          'process.env': { NODE_ENV: JSON.stringify(project.env) },\r\n          __DEV__,\r\n          __TEST__,\r\n          __PROD__,\r\n        },\r\n        project.globals\r\n      )\r\n    ),\r\n  ],\r\n  node: {\r\n    // disable node constants so constants.js file is used instead (see https://webpack.js.org/configuration/node/)\r\n    constants: false,\r\n  },\r\n}\r\n\r\n// JavaScript\r\n// ------------------------------------\r\nconfig.module.rules.push({\r\n  test: /\\.(js|jsx)$/,\r\n  exclude: [\r\n    /node_modules/,\r\n    /redux-firestore\\/es/,\r\n    /react-redux-firebase\\/es/,\r\n    // Add other packages that you are npm linking here\r\n  ],\r\n  use: [\r\n    {\r\n      loader: 'babel-loader',\r\n      query: {\r\n        cacheDirectory: true,\r\n        // ignore root .babelrc (Check issue #59 for more details)\r\n        babelrc: false,\r\n        plugins: [\r\n          'lodash',\r\n          'transform-decorators-legacy',\r\n          'babel-plugin-transform-class-properties',\r\n          'babel-plugin-syntax-dynamic-import',\r\n          'babel-plugin-transform-export-extensions',\r\n          [\r\n            'babel-plugin-transform-runtime',\r\n            {\r\n              corejs: 2,\r\n              helpers: true,\r\n              polyfill: false, // we polyfill needed features in src/normalize.js\r\n              regenerator: true,\r\n            },\r\n          ],\r\n          [\r\n            'babel-plugin-transform-object-rest-spread',\r\n            {\r\n              useBuiltIns: true, // we polyfill Object.assign in src/normalize.js\r\n            },\r\n          ],\r\n        ],\r\n        presets: [\r\n          'babel-preset-react',\r\n          [\r\n            'babel-preset-env',\r\n            {\r\n              targets: {\r\n                ie9: true,\r\n                uglify: true,\r\n                modules: false,\r\n              },\r\n            },\r\n          ],\r\n        ],\r\n      },\r\n    },\r\n  ],\r\n})\r\n\r\n// Styles\r\n// ------------------------------------\r\nconst extractStyles = new ExtractTextPlugin({\r\n  filename: 'styles/[name].[contenthash].css',\r\n  allChunks: true,\r\n  disable: __DEV__,\r\n})\r\n\r\nconfig.module.rules.push({\r\n  test: /\\.(sass|scss)$/,\r\n  loader: extractStyles.extract({\r\n    fallback: 'style-loader',\r\n    use: [\r\n      {\r\n        loader: 'css-loader',\r\n        options: {\r\n          sourceMap: project.sourcemaps,\r\n          modules: true,\r\n          importLoaders: 2,\r\n          localIdentName: '[name]__[local]___[hash:base64:5]',\r\n          minimize: {\r\n            autoprefixer: {\r\n              add: true,\r\n              remove: true,\r\n              browsers: ['last 2 versions'],\r\n            },\r\n            discardComments: {\r\n              removeAll: true,\r\n            },\r\n            discardUnused: false,\r\n            mergeIdents: false,\r\n            reduceIdents: false,\r\n            safe: true,\r\n            sourcemap: project.sourcemaps,\r\n          },\r\n        },\r\n      },\r\n      {\r\n        loader: 'sass-loader',\r\n        options: {\r\n          sourceMap: project.sourcemaps,\r\n          includePaths: [inProjectSrc('styles')],\r\n        },\r\n      },\r\n    ],\r\n  }),\r\n})\r\nconfig.plugins.push(extractStyles)\r\n\r\n// Images\r\n// ------------------------------------\r\nconfig.module.rules.push(\r\n  {\r\n    test: /\\.(png|jpg|gif)$/,\r\n    loader: 'url-loader',\r\n    options: {\r\n      limit: 8192,\r\n    },\r\n  },\r\n  {\r\n    test: /octicons\\.css$/,\r\n    loader: 'url-loader',\r\n    options: {\r\n      limit: 8192,\r\n    },\r\n  }\r\n)\r\n\r\n// Fonts\r\n// ------------------------------------\r\n;[\r\n  ['woff', 'application/font-woff'],\r\n  ['woff2', 'application/font-woff2'],\r\n  ['otf', 'font/opentype'],\r\n  ['ttf', 'application/octet-stream'],\r\n  ['eot', 'application/vnd.ms-fontobject'],\r\n  ['svg', 'image/svg+xml'],\r\n].forEach(font => {\r\n  const extension = font[0]\r\n  const mimetype = font[1]\r\n\r\n  config.module.rules.push({\r\n    test: new RegExp(`\\\\.${extension}$`),\r\n    loader: 'url-loader',\r\n    options: {\r\n      name: 'fonts/[name].[ext]',\r\n      limit: 10000,\r\n      mimetype,\r\n    },\r\n  })\r\n})\r\n\r\n// HTML Template\r\n// ------------------------------------\r\nconfig.plugins.push(\r\n  new HtmlWebpackPlugin({\r\n    template: inProjectSrc('index.html'),\r\n    inject: true,\r\n    minify: {\r\n      collapseWhitespace: true,\r\n    },\r\n  })\r\n)\r\n\r\n// Development Tools\r\n// ------------------------------------\r\nif (__DEV__) {\r\n  config.entry.main.push(\r\n    `webpack-hot-middleware/client.js?path=${\r\n      config.output.publicPath\r\n    }__webpack_hmr`\r\n  )\r\n  config.plugins.push(\r\n    new webpack.HotModuleReplacementPlugin(),\r\n    new webpack.NamedModulesPlugin()\r\n  )\r\n}\r\n\r\n// Bundle Splitting\r\n// ------------------------------------\r\nif (!__TEST__) {\r\n  const bundles = ['normalize', 'manifest']\r\n\r\n  if (project.vendors && project.vendors.length) {\r\n    bundles.unshift('vendor')\r\n    config.entry.vendor = project.vendors\r\n  }\r\n  config.plugins.push(\r\n    new webpack.optimize.CommonsChunkPlugin({ names: bundles })\r\n  )\r\n}\r\n\r\n// Production Optimizations\r\n// ------------------------------------\r\nif (__PROD__) {\r\n  config.plugins.push(\r\n    new webpack.LoaderOptionsPlugin({\r\n      minimize: true,\r\n      debug: false,\r\n    }),\r\n    new webpack.optimize.UglifyJsPlugin({\r\n      sourceMap: !!config.devtool,\r\n      comments: false,\r\n      compress: {\r\n        warnings: false,\r\n        screw_ie8: true,\r\n        conditionals: true,\r\n        unused: true,\r\n        comparisons: true,\r\n        sequences: true,\r\n        dead_code: true,\r\n        evaluate: true,\r\n        if_return: true,\r\n        join_vars: true,\r\n      },\r\n    }),\r\n    new FaviconsWebpackPlugin({\r\n      logo: 'static/logo.svg',\r\n      inject: true,\r\n      title: 'portfolio',\r\n      persistentCache: true,\r\n      icons: {\r\n        favicons: true,\r\n        appleIcon: true,\r\n        appleStartup: true,\r\n        firefox: true,\r\n        android: true,\r\n      },\r\n    })\r\n  )\r\n}\r\n\r\nmodule.exports = config\r\n```"}}
{"actor":{"display_login":"dustingraves"}}