Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 1dff1a5

Browse files
committed
default export and outputs es5/umd (main) and es5/esm (module)
add default export use rollup to create umd build w/ global ('esriLoader') move source to src folder and rename to esri-loader added CHANGELOG
1 parent 5d070e5 commit 1dff1a5

File tree

7 files changed

+64
-10
lines changed

7 files changed

+64
-10
lines changed

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jspm_packages
3737
.node_repl_history
3838

3939
# build output
40-
*.js
41-
*.map
42-
*.d.ts
40+
esri-loader.js
41+
src/*.js
42+
src/*.map
43+
src/*.d.ts

.npmignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jspm_packages
3737
.node_repl_history
3838

3939
# TypeScript source
40-
*.ts
41-
!*.d.ts
40+
src/*.ts
41+
!src/*.d.ts

CHANGELOG.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# esri-loader Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## Unreleased
6+
7+
### Added
8+
- add default export
9+
10+
### Fixed
11+
- build outputs es5/umd (main) and es5/esm (module)
12+
13+
## 0.2.0
14+
15+
### Added
16+
- enable pre-loading the ArcGIS API
17+
- default to version 4.3 of the ArcGIS API
18+
19+
## 0.1.3
20+
21+
### Fixed
22+
- default to version 4.2 of the ArcGIS API
23+
- use HTTPS by default
24+
25+
## 0.1.2
26+
27+
### Fixed
28+
- finally got `import from 'esri-loader' working from Angular/TS apps
29+
30+
## 0.1.1
31+
32+
### Fixed
33+
- try to fix Error: Cannot find module "." in consuming TS apps
34+
35+
## 0.1.0
36+
37+
### Added
38+
- copied over source from angular-cli-esri and set up TS build

package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
"name": "esri-loader",
33
"version": "0.2.0",
44
"description": "A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications",
5-
"main": "index.js",
6-
"types": "index.d.ts",
5+
"main": "esri-loader.js",
6+
"module": "src/esri-loader.js",
7+
"types": "src/esri-loader.d.ts",
78
"scripts": {
89
"test": "tsc",
9-
"build": "tsc",
10+
"build": "tsc && rollup -c",
1011
"prepublish": "npm run build",
1112
"start": "tsc -w"
1213
},
@@ -29,6 +30,7 @@
2930
},
3031
"homepage": "https://github.com/tomwayson/esri-loader#readme",
3132
"devDependencies": {
33+
"rollup": "^0.41.6",
3234
"typescript": "^2.0.10"
3335
}
3436
}

rollup.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
entry: 'src/esri-loader.js',
3+
format: 'umd',
4+
dest: 'esri-loader.js',
5+
moduleName: 'esriLoader',
6+
exports: 'named'
7+
};

index.ts src/esri-loader.ts

+6
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ export function dojoRequire(modules: string[], callback: Function) {
6464
}
6565
}
6666
}
67+
68+
export default {
69+
isLoaded,
70+
bootstrap,
71+
dojoRequire
72+
}

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"compilerOptions": {
33
"declaration": true,
44
"target": "es5",
5-
"module": "commonjs",
5+
"module": "es2015",
66
"sourceMap": true,
77
"emitDecoratorMetadata": true,
88
"experimentalDecorators": true,
99
"removeComments": false,
1010
"noImplicitAny": false
1111
},
1212
"files": [
13-
"index.ts"
13+
"src/esri-loader.ts"
1414
],
1515
"exclude": [
1616
"node_modules"

0 commit comments

Comments
 (0)