Skip to content
This repository was archived by the owner on Apr 9, 2018. It is now read-only.

Commit df5aa0c

Browse files
authored
Merge pull request #12 from tomwayson/ng-module-FESM-build
[DNM] add NgModule & build FESM output using ngc & rollup
2 parents 2e4248e + 68e28f9 commit df5aa0c

File tree

8 files changed

+84
-28
lines changed

8 files changed

+84
-28
lines changed

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ jspm_packages
3737
.node_repl_history
3838

3939
# build output
40-
*.js
41-
*.map
42-
*.d.ts
40+
build
41+
dist

index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
{
22
"name": "angular2-esri-loader",
33
"version": "1.0.0",
4-
"description": "An Angular 2 service to help you load ArcGIS API for JavaScript Modules",
4+
"description": "An Angular (2+) service to help you load ArcGIS API for JavaScript Modules",
55
"scripts": {
6-
"test": "tsc",
7-
"prepublish": "tsc",
8-
"preversion": "npm run test && git add README.md CHANGELOG.md"
6+
"build": "npm run clean && npm run ngc && npm run rollup && npm run copy",
7+
"clean": "rimraf build dist",
8+
"copy": "copyfiles -u 1 \"build/**/*{.d.ts,.js.map,.metadata.json}\" dist && copyfiles -f src/package.json README.md dist",
9+
"ngc": "ngc -p tsconfig.json",
10+
"rollup": "rollup build/angular2-esri-loader.js -o dist/angular2-esri-loader.js",
11+
"prepublish": "npm run build",
12+
"preversion": "npm run test && git add README.md CHANGELOG.md",
13+
"test": "ngc"
914
},
1015
"repository": {
1116
"type": "git",
1217
"url": "git+https://github.com/tomwayson/angular2-esri-loader.git"
1318
},
1419
"keywords": [
15-
"Angular2",
20+
"Angular",
1621
"Esri",
1722
"ArcGIS"
1823
],
@@ -22,14 +27,17 @@
2227
"url": "https://github.com/tomwayson/angular2-esri-loader/issues"
2328
},
2429
"homepage": "https://github.com/tomwayson/angular2-esri-loader#readme",
25-
"dependencies": {
26-
"@angular/core": "^2.1.0",
27-
"esri-loader": "^1.0.0",
28-
"rxjs": "5.0.0-beta.12",
29-
"zone.js": "^0.6.23"
30-
},
3130
"devDependencies": {
32-
"typescript": "^2.0.10"
31+
"@angular/compiler": "^4.1.1",
32+
"@angular/compiler-cli": "^4.1.1",
33+
"@angular/core": "^4.1.1",
34+
"copyfiles": "^1.2.0",
35+
"esri-loader": "^1.0.0",
36+
"rimraf": "^2.6.1",
37+
"rollup": "^0.41.6",
38+
"rxjs": "^5.3.0",
39+
"typescript": "^2.0.10",
40+
"zone.js": "^0.8.5"
3341
},
3442
"typings": "index.d.ts"
3543
}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './services/esri-loader.module';

src/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "angular2-esri-loader",
3+
"version": "0.1.11",
4+
"description": "An Angular (2+) service to help you load ArcGIS API for JavaScript modules",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/tomwayson/angular2-esri-loader.git"
8+
},
9+
"keywords": [
10+
"Angular",
11+
"Esri",
12+
"ArcGIS"
13+
],
14+
"author": "Tom Wayson <[email protected]> (https://tomwayson.com)",
15+
"license": "Apache-2.0",
16+
"bugs": {
17+
"url": "https://github.com/tomwayson/angular2-esri-loader/issues"
18+
},
19+
"homepage": "https://github.com/tomwayson/angular2-esri-loader#readme",
20+
"dependencies": {
21+
"esri-loader": "^1.0.0"
22+
},
23+
"peerDependencies": {
24+
"@angular/core": "^4.1.1",
25+
"rxjs": "^5.3.0",
26+
"zone.js": "^0.8.5"
27+
},
28+
"module": "angular2-esri-loader.js",
29+
"typings": "angular2-esri-loader.d.ts"
30+
}

src/services/esri-loader.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {NgModule} from '@angular/core';
2+
import { EsriLoaderService } from './esri-loader.service';
3+
export * from './esri-loader.service';
4+
5+
@NgModule({
6+
providers: [EsriLoaderService]
7+
})
8+
export class EsriLoaderModule {}
File renamed without changes.

tsconfig.json

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
{
22
"compilerOptions": {
3-
"noImplicitAny": false,
4-
"module": "commonjs",
5-
"target": "es5",
6-
"emitDecoratorMetadata": true,
7-
"experimentalDecorators": true,
8-
"sourceMap": true,
3+
"baseUrl": "./src",
94
"declaration": true,
5+
"experimentalDecorators": true,
6+
"inlineSources": true,
107
"lib": [
118
"es2015",
129
"dom"
13-
]
10+
],
11+
"module": "es2015", "moduleResolution": "node",
12+
"noImplicitAny": true,
13+
"outDir": "./build",
14+
"rootDir": "./src",
15+
"skipLibCheck": true,
16+
"sourceMap": true,
17+
"stripInternal": true,
18+
"suppressImplicitAnyIndexErrors": true,
19+
"target": "es5",
20+
"types": []
1421
},
1522
"files": [
16-
"index.ts"
23+
"./src/index.ts"
1724
],
18-
"exclude": [
19-
"node_modules"
20-
]
21-
}
25+
"angularCompilerOptions": {
26+
"annotateForClosureCompiler": true,
27+
"strictMetadataEmit": true,
28+
"skipTemplateCodegen": true,
29+
"flatModuleOutFile": "angular2-esri-loader.js",
30+
"flatModuleId": "angular2-esri-loader"
31+
}
32+
}

0 commit comments

Comments
 (0)