Merge pull request #4928 from GabrielInTheWorld/fixIE
Adds compiling to ES5 for IE11
This commit is contained in:
commit
1900ecb1ea
@ -26,9 +26,21 @@
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/manifest.json",
|
||||
{ "glob": "**/*", "input": "node_modules/tinymce/skins", "output": "/tinymce/skins/" },
|
||||
{ "glob": "**/*", "input": "node_modules/tinymce/themes", "output": "/tinymce/themes/" },
|
||||
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" }
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/tinymce/skins",
|
||||
"output": "/tinymce/skins/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/tinymce/themes",
|
||||
"output": "/tinymce/themes/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/tinymce/plugins",
|
||||
"output": "/tinymce/plugins/"
|
||||
}
|
||||
],
|
||||
"styles": ["src/styles.scss"],
|
||||
"scripts": ["node_modules/tinymce/tinymce.min.js"],
|
||||
@ -36,12 +48,10 @@
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"fileReplacements": [{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
@ -52,13 +62,14 @@
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"serviceWorker": true,
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "5mb",
|
||||
"maximumError": "10mb"
|
||||
}
|
||||
]
|
||||
"budgets": [{
|
||||
"type": "initial",
|
||||
"maximumWarning": "5mb",
|
||||
"maximumError": "10mb"
|
||||
}]
|
||||
},
|
||||
"es5": {
|
||||
"tsConfig": "./tsconfig-es5.app.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -70,6 +81,9 @@
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "client:build:production"
|
||||
},
|
||||
"es5": {
|
||||
"browserTarget": "client:build:es5"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -91,9 +105,21 @@
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/manifest.json",
|
||||
{ "glob": "**/*", "input": "node_modules/tinymce/skins", "output": "/tinymce/skins/" },
|
||||
{ "glob": "**/*", "input": "node_modules/tinymce/themes", "output": "/tinymce/themes/" },
|
||||
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" }
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/tinymce/skins",
|
||||
"output": "/tinymce/skins/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/tinymce/themes",
|
||||
"output": "/tinymce/themes/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "node_modules/tinymce/plugins",
|
||||
"output": "/tinymce/plugins/"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -12,6 +12,7 @@
|
||||
"ng": "ng",
|
||||
"ng-high-memory": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng",
|
||||
"start": "ng serve --proxy-config proxy.conf.json --host=0.0.0.0",
|
||||
"start-es5": "ng serve --proxy-config proxy.conf.json --host=0.0.0.0 --configuration es5",
|
||||
"build": "npm run ng-high-memory -- build --prod",
|
||||
"test": "ng test",
|
||||
"lint-check": "ng lint",
|
||||
|
@ -457,7 +457,8 @@ export class PdfDocumentService {
|
||||
const vfs = await this.initVfs();
|
||||
await this.loadAllImages(vfs);
|
||||
|
||||
if (typeof Worker !== 'undefined') {
|
||||
const isIE = /msie\s|trident\//i.test(window.navigator.userAgent);
|
||||
if (typeof Worker !== 'undefined' && !isIE) {
|
||||
const worker = new Worker('./pdf-worker.worker', {
|
||||
type: 'module'
|
||||
});
|
||||
@ -485,7 +486,7 @@ export class PdfDocumentService {
|
||||
});
|
||||
} else {
|
||||
this.matSnackBar.dismiss();
|
||||
this.matSnackBar.open(this.translate.instant('Web workers are not supported on your browser.'), '', {
|
||||
this.matSnackBar.open(this.translate.instant('Cannot create PDF files on this browser.'), '', {
|
||||
duration: 0
|
||||
});
|
||||
}
|
||||
|
@ -15,11 +15,21 @@
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
* BROWSER POLYFILLS
|
||||
*/
|
||||
|
||||
import 'core-js/es7/object';
|
||||
import 'core-js/es7/array';
|
||||
import 'core-js/es6/object';
|
||||
import 'core-js/es6/array';
|
||||
|
||||
// forEach fix for IE11
|
||||
if ('NodeList' in window && !NodeList.prototype.forEach) {
|
||||
NodeList.prototype.forEach = function(callback, thisArg) {
|
||||
thisArg = thisArg || window;
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
callback.call(thisArg, this[i], i, this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
@ -36,7 +46,7 @@ import 'core-js/es7/reflect';
|
||||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||
*/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
|
6
client/tsconfig-es5.app.json
Normal file
6
client/tsconfig-es5.app.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.app.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user