@@ -25,6 +25,24 @@ module.exports = (api, opts, rootOpts) => {
25
25
} )
26
26
}
27
27
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
+
28
46
// Render vuetify plugin file
29
47
api . render ( {
30
48
'./src/plugins/vuetify.js' : './templates/default/src/plugins/vuetify.js'
@@ -115,16 +133,16 @@ module.exports = (api, opts, rootOpts) => {
115
133
} )
116
134
}
117
135
118
- // Add Material Icons
119
- {
136
+ // Add Material Icons (unless electron)
137
+ if ( api . hasPlugin ( 'electron-builder' ) === false ) {
120
138
const indexPath = api . resolve ( './public/index.html' )
121
139
122
140
let content = fs . readFileSync ( indexPath , { encoding : 'utf8' } )
123
141
124
142
const lines = content . split ( / \r ? \n / g) . reverse ( )
125
143
126
144
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">'
128
146
129
147
content = lines . reverse ( ) . join ( '\n' )
130
148
fs . writeFileSync ( indexPath , content , { encoding : 'utf8' } )
0 commit comments