Skip to content

Commit

Permalink
Fix example and bump package in website
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Sep 18, 2019
1 parent f0943f3 commit 5476484
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/draw-polygon/src/app.js
Expand Up @@ -69,7 +69,7 @@ export default class App extends Component {
_renderControlPanel = () => {
const features = this._editorRef && this._editorRef.getFeatures();
let featureIndex = this.state.selectedFeatureIndex;
if (featureIndex === null) {
if (features && featureIndex === null) {
featureIndex = features.length - 1;
}
const polygon = features && features.length ? features[featureIndex] : null;
Expand Down
6 changes: 6 additions & 0 deletions website/.eslintrc
Expand Up @@ -7,6 +7,12 @@
"eslint-config-uber-jsx",
"eslint-config-uber-es2015"
],
"overrides": [{
"files": ["webpack/*.js"],
"rules": {
"import/no-extraneous-dependencies": 0
}
}],
"rules": {
"guard-for-in": 0,
"camelcase": 0,
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Expand Up @@ -29,7 +29,7 @@
"prop-types": "^15.5.8",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react-map-gl-draw": "^0.14.10",
"react-map-gl-draw": "^0.15.0",
"react-redux": "^4.4.5",
"react-router": "^3.2.0",
"redux": "^3.6.0",
Expand Down
13 changes: 3 additions & 10 deletions website/webpack/dev.js
Expand Up @@ -4,24 +4,17 @@ const {resolve} = require('path');
const config = require('./config');

module.exports = Object.assign(config, {

mode: 'development',

entry: [
'webpack-hot-middleware/client',
'./src/main'
],
entry: ['webpack-hot-middleware/client', './src/main'],

devServer: {
port: 3000,
progress: true,
contentBase: resolve(__dirname, '../src/static')
contentBase: [resolve(__dirname, '../src/static'), resolve(__dirname, '../../')]
},

devtool: 'cheap-source-maps',

plugins: config.plugins.concat([
new webpack.HotModuleReplacementPlugin()
])

plugins: config.plugins.concat([new webpack.HotModuleReplacementPlugin()])
});

0 comments on commit 5476484

Please sign in to comment.