# HG changeset patch # User Lucas Thompson # Date 1487888152 0 # Node ID 8f2b2aed0df14f806fd8288c02521eeaa8e16916 # Parent 140f0a13dec90788d649575f9426b6ff89113aff Update cli config to conform to latest version, needed to move around my worker bootstrapping bodge. Angular-cli for some reason now includes global scripts as strings in the webpack bundle, and they are eval'ed. So TypeScript no longer gets compiled. So once again I chase the mouse, re-purposing the new polyfill field to compile and bundle externals.ts once more! diff -r 140f0a13dec9 -r 8f2b2aed0df1 angular-cli.json --- a/angular-cli.json Thu Feb 23 22:13:04 2017 +0000 +++ b/angular-cli.json Thu Feb 23 22:15:52 2017 +0000 @@ -9,10 +9,12 @@ "outDir": "dist", "assets": [ "assets", - "favicon.ico" + "favicon.ico", + "bootstrap-feature-extraction-worker.js" ], "index": "index.html", "main": "main.ts", + "polyfills": "externals.ts", "test": "test.ts", "tsconfig": "tsconfig.json", "prefix": "app", @@ -21,11 +23,10 @@ "styles.css" ], "scripts": [ - "../node_modules/requirejs/require.js", - "externals.ts" + "../node_modules/requirejs/require.js" ], + "environmentSource": "environments/environment.ts", "environments": { - "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } diff -r 140f0a13dec9 -r 8f2b2aed0df1 src/app/app.module.ts --- a/src/app/app.module.ts Thu Feb 23 22:13:04 2017 +0000 +++ b/src/app/app.module.ts Thu Feb 23 22:15:52 2017 +0000 @@ -12,7 +12,7 @@ import { FeatureExtractionService } from "./services/feature-extraction/feature-extraction.service"; import { FeatureExtractionMenuComponent } from "./feature-extraction-menu/feature-extraction-menu.component"; -function createAudioContext(): AudioContext { +export function createAudioContext(): AudioContext { return new ( (window as any).AudioContext || (window as any).webkitAudioContext @@ -34,7 +34,7 @@ MaterialModule ], providers: [ - {provide: HTMLAudioElement, useValue: new Audio()}, // TODO use something more generic than HTMLAudioElement + {provide: HTMLAudioElement, useValue: new Audio() }, // TODO use something more generic than HTMLAudioElement {provide: 'AudioContext', useValue: createAudioContext()}, // use a string token, Safari doesn't seem to like AudioContext AudioPlayerService, FeatureExtractionService, diff -r 140f0a13dec9 -r 8f2b2aed0df1 src/bootstrap-feature-extraction-worker.js --- a/src/bootstrap-feature-extraction-worker.js Thu Feb 23 22:13:04 2017 +0000 +++ b/src/bootstrap-feature-extraction-worker.js Thu Feb 23 22:15:52 2017 +0000 @@ -2,8 +2,9 @@ * Created by lucas on 01/12/2016. */ let window = {}; -importScripts('inline.bundle.js'); // provides webpackJsonp +importScripts('/inline.bundle.js'); // provides webpackJsonp const webpackJsonp = window['webpackJsonp']; -importScripts('scripts.bundle.js'); // needs webpackJsonp, hence above - provides require +importScripts('/scripts.bundle.js'); // needs webpackJsonp, hence above - provides RequireJS +importScripts('/polyfills.bundle.js'); // provides the compiled FeatureExtractionWorker new (require('feature-extraction-worker'))(self, requirejs);