11'use strict'
2+ const svg2png = require ( 'svg2png' )
23const utils = require ( './utils' )
34const webpack = require ( 'webpack' )
45const config = require ( '../config' )
@@ -53,7 +54,7 @@ const devWebpackConfig = merge(baseWebpackConfig, {
5354 new webpack . NamedModulesPlugin ( ) , // HMR shows correct file names in console on update.
5455 new webpack . NoEmitOnErrorsPlugin ( ) ,
5556 new AppManifestWebpackPlugin ( {
56- logo : path . resolve ( __dirname , '../static/icon .svg' ) ,
57+ logo : path . resolve ( __dirname , '../src/assets/logo .svg' ) ,
5758 prefix : '.' ,
5859 output : '/static/icons-[hash:8]/' ,
5960 inject : true ,
@@ -77,9 +78,16 @@ const devWebpackConfig = merge(baseWebpackConfig, {
7778 new CopyWebpackPlugin ( [
7879 {
7980 from : path . resolve ( __dirname , '../static' ) ,
80- to : config . dev . assetsSubDirectory ,
81+ to : config . build . assetsSubDirectory ,
8182 ignore : [ '.*' ]
8283 } ,
84+ {
85+ from : path . resolve ( __dirname , '../src/assets/logo.svg' ) ,
86+ to : path . join ( config . build . assetsSubDirectory , 'ogIcon.png' ) ,
87+ transform ( content , path ) {
88+ return Promise . resolve ( svg2png ( content , { width : 400 , height : 400 } ) ) ;
89+ }
90+ } ,
8391 {
8492 from : path . resolve ( __dirname , '../humans.txt' ) ,
8593 to : config . build . assetsRoot ,
0 commit comments