diff --git a/.eslintrc.js b/.eslintrc.js index c0128b6..1053bb4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -43,6 +43,7 @@ module.exports = { } ], 'no-bitwise': 'off', + 'no-unused-expressions': ["error", { "allowShortCircuit": true }], 'function-paren-newline': 'off', } } diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index c48c623..5fa1dc5 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -8,6 +8,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); +const ServiceWorkerWebpackPlugin = require("serviceworker-webpack-plugin"); const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const VueLoaderPlugin = require('vue-loader/lib/plugin') @@ -189,6 +190,9 @@ module.exports = { child_process: 'empty', }, plugins: [ + new ServiceWorkerWebpackPlugin({ + entry: path.join(__dirname, '../src/sw.js'), + }), new VueLoaderPlugin(), new MiniCssExtractPlugin({ filename: utils.assetsPath('css/[name].[contenthash:4].css'), diff --git a/package.json b/package.json index 83cf8c6..119564f 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "nosleep.js": "^0.7.0", "ol": "^5.1.3", "roboto-fontface": "^0.9.0", + "serviceworker-webpack-plugin": "^1.0.1", "vue": "^2.5.2", "vue-i18n": "^8.0.0", "vue-router": "^3.0.1", diff --git a/src/App.vue b/src/App.vue index a621878..fdce398 100644 --- a/src/App.vue +++ b/src/App.vue @@ -63,6 +63,8 @@ diff --git a/src/components/Map.vue b/src/components/Map.vue index 99f32c3..0b8358f 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -46,6 +46,7 @@ import compassIcon from '@/assets/compass.svg'; import compassNorthIcon from '@/assets/compassNorth.svg'; import unknownMarkerIcon from '@/assets/unknownMarker.svg'; import * as constants from '@/constants'; +import REPORT_TYPES from '@/report-types'; import { distance } from '@/tools'; const MAIN_VECTOR_LAYER_NAME = 'MAIN'; @@ -177,7 +178,7 @@ export default { ? constants.LARGE_ICON_SCALE : constants.NORMAL_ICON_SCALE ), - src: constants.REPORT_TYPES[marker.type].marker, + src: REPORT_TYPES[marker.type].marker, }), })); // Add the marker to the map and keep a reference to it diff --git a/src/components/ReportCard.vue b/src/components/ReportCard.vue index a21b756..7cf4559 100644 --- a/src/components/ReportCard.vue +++ b/src/components/ReportCard.vue @@ -49,7 +49,8 @@