From d7c1497c98edc4f677037dbf4afb15c1ec20f5fc Mon Sep 17 00:00:00 2001 From: Joshua Marx Date: Tue, 24 Dec 2019 14:26:11 -0800 Subject: [PATCH] fixed build issues --- .eslintrc.js | 1 + package.json | 9 +++++---- src/components/main/header/Header.jsx | 2 +- webpack.config.js | 8 -------- webpack.dev.js | 15 +++++++++++++++ webpack.prod.js | 6 ++++++ 6 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 webpack.dev.js create mode 100644 webpack.prod.js diff --git a/.eslintrc.js b/.eslintrc.js index 16fdf3750..ddb63a467 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,5 +25,6 @@ module.exports = { 'react', ], rules: { + 'linebreak-style': 'off', }, }; diff --git a/package.json b/package.json index a59c99177..35f4e0117 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,13 @@ "react-leaflet": "^2.4.0", "react-leaflet-choropleth": "^2.0.0", "react-test-renderer": "^16.12.0", - "react-vis": "^1.11.7" + "react-vis": "^1.11.7", + "webpack-merge": "^4.2.2" }, "scripts": { - "start": "npm start", - "dev": "webpack-dev-server", - "build": "webpack", + "start": "npm run dev", + "dev": "webpack-dev-server --config webpack.dev.js", + "build": "webpack --config webpack.prod.js", "test": "jest", "predeploy": "npm run build", "deploy": "gh-pages -d build" diff --git a/src/components/main/header/Header.jsx b/src/components/main/header/Header.jsx index c94674d24..780998960 100644 --- a/src/components/main/header/Header.jsx +++ b/src/components/main/header/Header.jsx @@ -1,6 +1,6 @@ import React from 'react'; import NCFilter from './NCFilter'; -import DataPicker from './DataPicker'; +import DataPicker from './dataPicker'; // import Dropdown from '../../common/Dropdown'; const Header = ({ diff --git a/webpack.config.js b/webpack.config.js index 169ac259e..7cc12fada 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -39,12 +39,4 @@ module.exports = { plugins: [ new Dotenv(), ], - devServer: { - open: true, - contentBase: './public', - compress: true, - port: 3000, - hot: true, - historyApiFallback: true, - }, }; diff --git a/webpack.dev.js b/webpack.dev.js new file mode 100644 index 000000000..53fb3d8a2 --- /dev/null +++ b/webpack.dev.js @@ -0,0 +1,15 @@ +const merge = require('webpack-merge'); +const config = require('./webpack.config.js'); + +module.exports = merge(config, { + mode: 'development', + devtool: 'inline-source-map', + devServer: { + open: true, + contentBase: './public', + compress: true, + port: 3000, + hot: true, + historyApiFallback: true, + }, +}); diff --git a/webpack.prod.js b/webpack.prod.js new file mode 100644 index 000000000..5efba7f55 --- /dev/null +++ b/webpack.prod.js @@ -0,0 +1,6 @@ +const merge = require('webpack-merge'); +const config = require('./webpack.config.js'); + +module.exports = merge(config, { + mode: 'production', +});