@@ -25,6 +25,24 @@ module.exports = (api, opts, rootOpts) => {
2525 } )
2626 }
2727
28+ if ( api . hasPlugin ( 'electron-builder' ) === true ) {
29+ // material icons pkg for electron
30+ api . extendPackage ( {
31+ devDependencies : {
32+ "material-design-icons-iconfont" : "^3.0.3" ,
33+ }
34+ } )
35+
36+ try {
37+ api . injectImports ( helpers . getMain ( ) ,
38+ `import 'material-design-icons-iconfont/dist/material-design-icons.css'`
39+ )
40+ } catch ( e ) {
41+ console . error ( e )
42+ }
43+ }
44+
45+
2846 // Render vuetify plugin file
2947 api . render ( {
3048 './src/plugins/vuetify.js' : './templates/default/src/plugins/vuetify.js'
@@ -115,16 +133,16 @@ module.exports = (api, opts, rootOpts) => {
115133 } )
116134 }
117135
118- // Add Material Icons
119- {
136+ // Add Material Icons (unless electron)
137+ if ( api . hasPlugin ( 'electron-builder' ) === false ) {
120138 const indexPath = api . resolve ( './public/index.html' )
121139
122140 let content = fs . readFileSync ( indexPath , { encoding : 'utf8' } )
123141
124142 const lines = content . split ( / \r ? \n / g) . reverse ( )
125143
126144 const lastLink = lines . findIndex ( line => line . match ( / ^ \s * < l i n k / ) )
127- lines [ lastLink ] += '\n\s\s\s\s <link href="https://fonts.googleapis.com/css?family=Roboto:100:300,400,500,700,900|Material+Icons" rel="stylesheet">'
145+ lines [ lastLink ] += '\n <link href="https://fonts.googleapis.com/css?family=Roboto:100:300,400,500,700,900|Material+Icons" rel="stylesheet">'
128146
129147 content = lines . reverse ( ) . join ( '\n' )
130148 fs . writeFileSync ( indexPath , content , { encoding : 'utf8' } )
0 commit comments