From 670cb6ceb581a0acaca19e46001055f27aaed25f Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Wed, 17 Jul 2019 16:55:17 +0200 Subject: [PATCH] Revert "Try to fix external js issue" This reverts commit 8a5170a92c39e90d742396445f65462f9138d485. --- Jenkinsfile.develop | 4 +++- .../resumable-file-upload => assets}/resumable.js | 0 .../resumable-file-upload.service.ts | 8 ++++---- projects/common/tsconfig.lib.json | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) rename projects/common/src/{lib/components/resumable-file-upload => assets}/resumable.js (100%) diff --git a/Jenkinsfile.develop b/Jenkinsfile.develop index b7a11f4..2552588 100644 --- a/Jenkinsfile.develop +++ b/Jenkinsfile.develop @@ -12,7 +12,9 @@ pipeline { } stage('build'){ steps { - sh '''ng build common''' + sh '''ng build common + cp projects/common/src/assets/resumable.js dist/common/fesm2015 + cp projects/common/src/assets/resumable.js dist/common/fesm5''' } } stage('npm publish'){ diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable.js b/projects/common/src/assets/resumable.js similarity index 100% rename from projects/common/src/lib/components/resumable-file-upload/resumable.js rename to projects/common/src/assets/resumable.js diff --git a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts index 1f877f0..156e830 100644 --- a/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts +++ b/projects/common/src/lib/components/resumable-file-upload/resumable-file-upload.service.ts @@ -4,7 +4,7 @@ import { Subject , of } from 'rxjs'; import { HttpClient, HttpParams } from "@angular/common/http"; -declare var Resumable; // avoid missing property error on require +declare var require; // avoid missing property error on require @Injectable() export class ResumableFileUploadService { @@ -26,8 +26,8 @@ export class ResumableFileUploadService { init = function () { this.ref - // require.ensure([], require => { - //let Resumable = require('./resumable.js'); + require.ensure([], require => { + let Resumable = require('./resumable.js'); var other = this; this.resumable = new Resumable( { @@ -105,7 +105,7 @@ export class ResumableFileUploadService { if (this.dropElement) this.resumable.assignDrop(this.dropElement); if (this.fileBrowseElement) this.resumable.assignBrowse(this.fileBrowseElement); if (this.directoryBrowseElement) this.resumable.assignBrowse(this.directoryBrowseElement, true); - + }); } addFiles = (files: any[], event: any, geoRefJson?: string, attributes?: any) => { diff --git a/projects/common/tsconfig.lib.json b/projects/common/tsconfig.lib.json index cfaa8a0..7d312cd 100644 --- a/projects/common/tsconfig.lib.json +++ b/projects/common/tsconfig.lib.json @@ -11,7 +11,7 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, - "types": ["node_modules/resumable/resumable.js"], + "types": [], "lib": [ "dom", "es2018"