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

Commit 99a529d

Browse files
committed
add NgModule & build FESM output using ngc & rollup
base folder structure on https://github.com/jasonaden/simple-ui-lib add an NgModule build FESM output using ngc & rollup remove package.main and have package.module point to FESM
1 parent 141788b commit 99a529d

File tree

8 files changed

+79
-27
lines changed

8 files changed

+79
-27
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: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
22
"name": "angular2-esri-loader",
33
"version": "0.1.11",
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"
6+
"build": "npm run clean && npm run ngc && npm run rollup && npm run copy",
7+
"clean": "rm -rf build dist",
8+
"copy": "rsync -a --exclude=*.js build/ dist && cp src/package.json dist/package.json && cp README.md dist/README.md",
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+
"test": "ngc"
813
},
914
"repository": {
1015
"type": "git",
1116
"url": "git+https://github.com/tomwayson/angular2-esri-loader.git"
1217
},
1318
"keywords": [
14-
"Angular2",
19+
"Angular",
1520
"Esri",
1621
"ArcGIS"
1722
],
@@ -21,14 +26,15 @@
2126
"url": "https://github.com/tomwayson/angular2-esri-loader/issues"
2227
},
2328
"homepage": "https://github.com/tomwayson/angular2-esri-loader#readme",
24-
"dependencies": {
25-
"@angular/core": "^2.1.0",
26-
"esri-loader": "^0.1.2",
27-
"rxjs": "5.0.0-beta.12",
28-
"zone.js": "^0.6.23"
29-
},
3029
"devDependencies": {
31-
"typescript": "^2.0.10"
30+
"@angular/compiler": "^4.0.2",
31+
"@angular/compiler-cli": "^4.0.2",
32+
"@angular/core": "^4.0.2",
33+
"esri-loader": "^0.3.1",
34+
"rollup": "^0.41.6",
35+
"rxjs": "^5.3.0",
36+
"typescript": "^2.0.10",
37+
"zone.js": "^0.8.5"
3238
},
3339
"typings": "index.d.ts"
3440
}

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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
"peerDependencies": {
21+
"@angular/core": "^4.0.1",
22+
"esri-loader": "^0.3.1",
23+
"rxjs": "^5.3.0",
24+
"zone.js": "^0.8.5"
25+
},
26+
"module": "angular2-esri-loader.js",
27+
"typings": "angular2-esri-loader.d.ts"
28+
}

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)