Skip to content

Commit

Permalink
Add transpiled ES Module build with microbundle
Browse files Browse the repository at this point in the history
- Export EPSG codes everywhere, so they can be accessed as .code instead of .default
- Set up index.js that imports and exports EPSG_*
- Add build target using microbundle

See geoblocks/base#4
  • Loading branch information
Roman Zoller committed Jan 25, 2019
1 parent 96db2d4 commit 7c6d54d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 6 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"name": "@geoblocks/proj",
"version": "0.3.0",
"description": "Geoblocks projections",
"main": "dist/proj.js",
"module": "dist/proj.js",
"source": "src/index.js",
"scripts": {
"build": "microbundle --format es",
"eslint": "eslint src/*.js",
"typecheck": "tsc --pretty",
"lint": "npm run eslint && npm run typecheck",
Expand All @@ -26,6 +30,7 @@
"babel-core": ">=7.0.0-bridge.0",
"babel-jest": ">=23.6.0",
"jest": ">=23.6.0",
"microbundle": "^0.9.0",
"ol": ">=5.3.0",
"proj4": ">=2.5.0",
"typedoc": ">=0.13.0",
Expand Down
2 changes: 1 addition & 1 deletion src/EPSG_2056.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import somerc from './somerc.js';
import {create} from './utils.js';

const code = 'EPSG:2056';
export const code = 'EPSG:2056';

const def = `
+proj=${somerc}
Expand Down
2 changes: 1 addition & 1 deletion src/EPSG_2154.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lcc from './lcc.js';
import {create} from './utils.js';

const code = 'EPSG:2154';
export const code = 'EPSG:2154';

const def = `
+proj=${lcc}
Expand Down
2 changes: 1 addition & 1 deletion src/EPSG_21781.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import somerc from './somerc.js';
import {create} from './utils.js';

const code = 'EPSG:21781';
export const code = 'EPSG:21781';

const def = `
+proj=${somerc}
Expand Down
2 changes: 1 addition & 1 deletion src/EPSG_27572.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lcc from './lcc.js';
import {create} from './utils.js';

const code = 'EPSG:27572';
export const code = 'EPSG:27572';

const def = `
+proj=${lcc}
Expand Down
2 changes: 1 addition & 1 deletion src/EPSG_32631.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import utm from './utm.js';
import {create} from './utils.js';

const code = 'EPSG:32631';
export const code = 'EPSG:32631';

const def = `
+proj=${utm}
Expand Down
2 changes: 1 addition & 1 deletion src/EPSG_3947.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lcc from './lcc.js';
import {create} from './utils.js';

const code = 'EPSG:3947';
export const code = 'EPSG:3947';

const def = `
+proj=${lcc}
Expand Down
15 changes: 15 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as EPSG_2056 from './EPSG_2056';
import * as EPSG_2154 from './EPSG_2154';
import * as EPSG_3947 from './EPSG_3947';
import * as EPSG_21781 from './EPSG_21781';
import * as EPSG_27572 from './EPSG_27572';
import * as EPSG_32631 from './EPSG_32631';

export {
EPSG_2056,
EPSG_2154,
EPSG_3947,
EPSG_21781,
EPSG_27572,
EPSG_32631,
};

0 comments on commit 7c6d54d

Please sign in to comment.