Remove babel minify as it causes problems with mapbox

This commit is contained in:
Kacper Donat 2020-02-08 14:27:08 +01:00
parent 7da2038e02
commit 5e4208067c
5 changed files with 14 additions and 11 deletions

View File

@ -37,7 +37,6 @@
"@types/mapbox-gl-leaflet": "^0.0.1",
"@types/uuid": "^3.4.6",
"@types/workbox-window": "^4.3.3",
"babel-minify-webpack-plugin": "^0.3.1",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^4.5.2",
"imagemin-webpack-plugin": "^2.3.0",

View File

@ -90,4 +90,4 @@ export class Application extends Vue {
this.intervals.departures = setInterval(() => this.updateDepartures({ stops: this.stops }), Math.max(5, settings.departures.interval) * 1000);
}
}
}
}

View File

@ -2,7 +2,7 @@ import Component from "vue-class-component";
import Vue from "vue";
import { Stop, StopGroup, StopGroups } from "../model";
import { Prop, Watch } from "vue-property-decorator";
import { ensureArray, FetchingState, filter, map } from "../utils";
import { ensureArray, FetchingState, filter, map, time } from "../utils";
import { debounce } from "../decorators";
import urls from '../urls';
@ -39,7 +39,7 @@ export class FinderComponent extends Vue {
const groups = map(
this.found,
(group: StopGroup, name: string) =>
group.filter(stop => !this.blacklist.some(blacklisted => blacklisted.id == stop.id))
group.filter(stop => !this.blacklist.some(blacklisted => blacklisted.id === stop.id))
) as StopGroups;
return filter(groups, group => group.length > 0);

View File

@ -67,3 +67,11 @@ export function get(object: any, path: string): any {
export function distinct<T>(value: T, index: number, array: T[]) {
return array.indexOf(value) === index;
}
export function time<T>(action: () => T, name?: string) {
const start = performance.now();
const result = action();
console.debug(`${name || 'this'} operation took ${performance.now() - start}ms`);
return result;
}

View File

@ -20,7 +20,8 @@ const config = {
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'vue$': 'vue/dist/vue.esm.js'
'vue$': 'vue/dist/vue.esm.js',
'mapbox-gl$': 'mapbox-gl/dist/mapbox-gl-unminified'
}
},
module: {
@ -71,12 +72,7 @@ const config = {
}],
swDest: '../service-worker.js'
})
],
optimization: {
minimizer: [
new BabelMinifyPlugin()
]
}
]
};
module.exports = (env, argv) => {