Skip to content

Commit

Permalink
Use Angular CLI instead of ngm for building
Browse files Browse the repository at this point in the history
Some commands:

npm run build      - to build the library.  Output is in dist/ng2-file-upload/.
npm run test       - to run tests.  Coverage report is in coverage/ as before.
npm run demo.serve - to build demo application and serve it through browsersync
npm run start      - to run demo application using `ng serve`.  Requires the library to be built and linked first.
  • Loading branch information
earshinov committed Aug 27, 2019
1 parent 6cb3f87 commit 7a34226
Show file tree
Hide file tree
Showing 18 changed files with 1,632 additions and 1,658 deletions.
48 changes: 36 additions & 12 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
"newProjectRoot": "projects",
"projects": {
"ng2-file-upload": {
"root": ".",
"sourceRoot": "src",
"projectType": "library",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/tsconfig.json",
"project": "src/ng-package.json"
}
}
}
},
"ng2-file-upload-demo": {
"root": "demo",
"sourceRoot": "demo/src",
"projectType": "application",
Expand Down Expand Up @@ -44,38 +58,48 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ng2-file-upload:build"
"browserTarget": "ng2-file-upload-demo:build"
},
"configurations": {
"production": {
"browserTarget": "ng2-file-upload:build:production"
"browserTarget": "ng2-file-upload-demo:build:production"
}
}
},
}
}
},
"ng2-file-upload-test": {
"root": ".",
"sourceRoot": "test",
"projectType": "library",
"architect": {
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "demo/src/../../scripts/test.ts",
"karmaConfig": "karma.conf.js",
"main": "test/test.ts",
"karmaConfig": "test/karma.conf.js",
"scripts": [],
"styles": [],
"tsConfig": "demo/src/tsconfig.json",
"assets": [
"demo/src/assets"
]
"tsConfig": "test/tsconfig.json"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [],
"exclude": []
"tsConfig": [
"src/tsconfig.json",
"demo/src/tsconfig.json",
"test/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ng2-file-upload",
"defaultProject": "ng2-file-upload-demo",
"schematics": {
"@schematics/angular:component": {
"prefix": "",
Expand Down
6 changes: 3 additions & 3 deletions demo/src/app/components/file-upload-section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ let doc = require('html-loader!markdown-loader!../../doc.md');
let tabDesc:Array<any> = [
{
heading: 'Simple',
ts: require('!!raw-loader?lang=typescript!./file-upload/simple-demo.ts'),
html: require('!!raw-loader?lang=markup!./file-upload/simple-demo.html'),
js: require('!!raw-loader?lang=javascript!./file-upload/file-catcher.js')
ts: require('!!raw-loader!./file-upload/simple-demo.ts').default,
html: require('!!raw-loader!./file-upload/simple-demo.html').default,
js: require('!!raw-loader!./file-upload/file-catcher.js').default
}
];

Expand Down
2 changes: 1 addition & 1 deletion demo/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './polyfills.ts';
import '../../scripts/polyfills.ts';

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
Expand Down
19 changes: 6 additions & 13 deletions demo/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": false,
"downlevelIteration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitHelpers": false,
"lib": ["es6", "dom"],
"types": [
"jasmine",
"webpack"
],
"mapRoot": "./",
"module": "esnext",
"moduleResolution": "node",
"outDir": "../temp/out-tsc",
"sourceMap": true,
"target": "es2015",
"typeRoots": [
"../node_modules/@types"
]
"target": "es2015"
},
"files": [
"../../scripts/typings.d.ts",
"main.ts",
"polyfills.ts"
"../../scripts/polyfills.ts"
],
"include": [
"*.d.ts",
"../../src/spec/*.spec.ts",
"../../scripts/test.ts"
"exclude": [
"**/*.spec.ts"
]
}
16 changes: 0 additions & 16 deletions demo/src/typings.d.ts

This file was deleted.

0 comments on commit 7a34226

Please sign in to comment.