Skip to content

Commit

Permalink
rebase and fix local webpack configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Apr 20, 2020
1 parent 04551ba commit a65818c
Show file tree
Hide file tree
Showing 35 changed files with 285 additions and 869 deletions.
4 changes: 2 additions & 2 deletions examples/react-map-gl-draw/app.js
Expand Up @@ -7,7 +7,7 @@ import {
DrawPointMode,
DrawLineStringMode,
DrawRectangleMode,
DrawPolygonMode
DrawPolygonMode,
} from '@nebula.gl/edit-modes';

import { MODES } from './constants';
Expand All @@ -19,7 +19,7 @@ const MODE_TO_HANDLER = {
[MODES.DRAW_POINT]: DrawPointMode,
[MODES.DRAW_PATH]: DrawLineStringMode,
[MODES.DRAW_RECTANGLE]: DrawRectangleMode,
[MODES.DRAW_POLYGON]: DrawPolygonMode
[MODES.DRAW_POLYGON]: DrawPolygonMode,
};

// eslint-disable-next-line no-process-env, no-undef
Expand Down
2 changes: 1 addition & 1 deletion examples/react-map-gl-draw/toolbar.js
Expand Up @@ -9,7 +9,7 @@ const ICON_MAP = [
{ id: MODES.DRAW_POINT, text: 'Draw Point', icon: 'icon-point.svg' },
{ id: MODES.DRAW_PATH, text: 'Draw Polyline', icon: 'icon-path.svg' },
{ id: MODES.DRAW_POLYGON, text: 'Draw Polygon', icon: 'icon-polygon.svg' },
{ id: MODES.DRAW_RECTANGLE, text: 'Draw Rectangle', icon: 'icon-rectangle.svg' }
{ id: MODES.DRAW_RECTANGLE, text: 'Draw Rectangle', icon: 'icon-rectangle.svg' },
];

const Container = styled.div`
Expand Down
20 changes: 13 additions & 7 deletions examples/webpack.config.local.js
Expand Up @@ -11,12 +11,12 @@ const resolve = require('path').resolve;
const webpack = require('webpack');

const LIB_DIR = resolve(__dirname, '..');
const MAIN_SRC_DIR = resolve(LIB_DIR, './modules/main');
const EDIT_MODES_SRC_DIR = resolve(LIB_DIR, './modules/edit-modes');
const LAYERS_SRC_DIR = resolve(LIB_DIR, './modules/layers');
const OVERLAYS_SRC_DIR = resolve(LIB_DIR, './modules/overlays');
const EDITOR_SRC_DIR = resolve(LIB_DIR, './modules/editor');
const REACT_EDITOR_LITE_SRC_DIR = resolve(LIB_DIR, './modules/react-map-gl-draw');
const MAIN_SRC_DIR = resolve(LIB_DIR, './modules/main/src/');
const EDIT_MODES_SRC_DIR = resolve(LIB_DIR, './modules/edit-modes/src/');
const LAYERS_SRC_DIR = resolve(LIB_DIR, './modules/layers/src/');
const OVERLAYS_SRC_DIR = resolve(LIB_DIR, './modules/overlays/src/');
const EDITOR_SRC_DIR = resolve(LIB_DIR, './modules/editor/src/');
const REACT_EDITOR_LITE_SRC_DIR = resolve(LIB_DIR, './modules/react-map-gl-draw/src');

// const babelConfig = require('../babel.config');

Expand All @@ -33,6 +33,7 @@ function makeLocalDevConfig(EXAMPLE_DIR = LIB_DIR) {
devtool: 'source-map',

resolve: {
extensions: ['.js', '.ts', '.tsx'],
alias: {
'nebula.gl/dist': MAIN_SRC_DIR,
'nebula.gl': MAIN_SRC_DIR,
Expand Down Expand Up @@ -70,10 +71,15 @@ function makeLocalDevConfig(EXAMPLE_DIR = LIB_DIR) {
rules: [
{
// Unfortunately, webpack doesn't import library sourcemaps on its own...
test: /\.js$/,
test: /\.js$|\.ts$|\.tsx$/,
use: ['source-map-loader'],
enforce: 'pre',
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
// Optional: Enables reading mapbox token from environment variable
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Expand Up @@ -3,6 +3,6 @@ module.exports = {
verbose: true,
testURL: 'http://localhost/',
collectCoverageFrom: ['modules/*/src/**/*.{ts,tsx}', '!**/node_modules/**'],
testPathIgnorePatterns: ['/node_modules/', '/website/'],
testPathIgnorePatterns: ['/node_modules/', '/lib/', '/website/'],
"preset": "ts-jest"
};
8 changes: 8 additions & 0 deletions lib/modules/react-map-gl-draw/src/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/modules/react-map-gl-draw/src/constants.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/modules/react-map-gl-draw/src/edit-modes/base-mode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 30 additions & 12 deletions lib/modules/react-map-gl-draw/src/edit-modes/editing-mode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a65818c

Please sign in to comment.