diff --git a/build/utils.js b/build/utils.js index d2317cc..5aa640a 100644 --- a/build/utils.js +++ b/build/utils.js @@ -95,7 +95,7 @@ exports.createNotifierCallback = () => { title: packageConfig.name, message: severity + ': ' + error.name, subtitle: filename || '', - icon: path.join(__dirname, 'static/icon.svg') + icon: path.join(__dirname, '../src/assets/logo.svg') }) } } diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index 9863dda..499806a 100755 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -1,4 +1,5 @@ 'use strict' +const svg2png = require('svg2png') const utils = require('./utils') const webpack = require('webpack') const config = require('../config') @@ -53,7 +54,7 @@ const devWebpackConfig = merge(baseWebpackConfig, { new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. new webpack.NoEmitOnErrorsPlugin(), new AppManifestWebpackPlugin({ - logo: path.resolve(__dirname, '../static/icon.svg'), + logo: path.resolve(__dirname, '../src/assets/logo.svg'), prefix: '.', output: '/static/icons-[hash:8]/', inject: true, @@ -77,9 +78,16 @@ const devWebpackConfig = merge(baseWebpackConfig, { new CopyWebpackPlugin([ { from: path.resolve(__dirname, '../static'), - to: config.dev.assetsSubDirectory, + to: config.build.assetsSubDirectory, ignore: ['.*'] }, + { + from: path.resolve(__dirname, '../src/assets/logo.svg'), + to: path.join(config.build.assetsSubDirectory, 'ogIcon.png'), + transform (content, path) { + return Promise.resolve(svg2png(content, { width: 400, height: 400 })); + } + }, { from: path.resolve(__dirname, '../humans.txt'), to: config.build.assetsRoot, diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 2edcc4d..fdfb39d 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -1,5 +1,6 @@ 'use strict' const path = require('path') +const svg2png = require('svg2png') const utils = require('./utils') const webpack = require('webpack') const config = require('../config') @@ -59,7 +60,7 @@ const webpackConfig = merge(baseWebpackConfig, { : { safe: true } }), new AppManifestWebpackPlugin({ - logo: path.resolve(__dirname, '../static/icon.svg'), + logo: path.resolve(__dirname, '../src/assets/logo.svg'), prefix: '.', output: '/static/icons-[hash:8]/', inject: true, @@ -132,6 +133,13 @@ const webpackConfig = merge(baseWebpackConfig, { to: config.build.assetsSubDirectory, ignore: ['.*'] }, + { + from: path.resolve(__dirname, '../src/assets/logo.svg'), + to: path.join(config.build.assetsSubDirectory, 'ogIcon.png'), + transform (content, path) { + return Promise.resolve(svg2png(content, { width: 400, height: 400 })); + } + }, { from: path.resolve(__dirname, '../humans.txt'), to: config.build.assetsRoot, diff --git a/config/index.js b/config/index.js index 67a33dc..52cab66 100644 --- a/config/index.js +++ b/config/index.js @@ -75,6 +75,6 @@ module.exports = { // OpenGraph-related variables ogURL: 'https://cyclo.phyks.me', - ogImage: 'https://cyclo.phyks.me/static/icon.svg', + ogImage: 'https://cyclo.phyks.me/static/ogIcon.png', } } diff --git a/index.html b/index.html index 96bc459..c616f00 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - +
@@ -7,6 +7,7 @@ + diff --git a/package.json b/package.json index a133deb..bfae6a4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "build": "node build/build.js" }, "dependencies": { - "app-manifest-webpack-plugin": "^1.1.3", "es6-promise": "^4.2.4", "isomorphic-fetch": "^2.2.1", "leaflet": "^1.3.1", @@ -29,6 +28,7 @@ "vuex": "^3.0.1" }, "devDependencies": { + "app-manifest-webpack-plugin": "^1.1.3", "autoprefixer": "^7.1.2", "babel-core": "^6.22.1", "babel-eslint": "^7.1.1", @@ -63,6 +63,7 @@ "rimraf": "^2.6.0", "semver": "^5.3.0", "shelljs": "^0.7.6", + "svg2png": "^4.1.1", "uglifyjs-webpack-plugin": "^1.1.1", "url-loader": "^0.5.8", "vue-loader": "^13.3.0", diff --git a/static/icon.svg b/src/assets/logo.svg similarity index 100% rename from static/icon.svg rename to src/assets/logo.svg diff --git a/src/views/Map.vue b/src/views/Map.vue index d487084..136e468 100644 --- a/src/views/Map.vue +++ b/src/views/Map.vue @@ -2,7 +2,7 @@{{ $t('about.summary') }}