Skip to content

Commit

Permalink
Merge pull request #55 from ojvribeiro/fix-favicon-in-app
Browse files Browse the repository at this point in the history
fix(core): make use of favicon more flexible
  • Loading branch information
ojvribeiro authored Oct 2, 2022
2 parents 326b177 + 6cd5408 commit f8026fd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .vulmix/mix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const mix = require('laravel-mix')
const path = require('path')
const fs = require('fs')

require('laravel-mix-serve')
require('laravel-mix-simple-image-processing')
Expand Down Expand Up @@ -40,8 +41,6 @@ class VulmixInit {
}
)

.copy('.vulmix/assets/icons/favicon-16x16.png', '_dist/assets/icons')

.sass(
'.vulmix/assets/sass/main.scss',
'_dist/assets/_vulmix/css/main.vulmix.css'
Expand All @@ -68,15 +67,33 @@ class VulmixInit {
},
})

.after(stats => {
/**
* Only prints user files to the terminal
*/
const assets = { ...stats.compilation.assets }
stats.compilation.assets = {}

for (const [path, asset] of Object.entries(assets)) {
if (!path.match(/((\.|_)vulmix|\.map)/)) {
stats.compilation.assets[path] = asset
}
}
})

if (fs.existsSync('assets/icons/')) {
mix.copy('assets/icons', '_dist/assets/icons')
}

/**
* Production mode
* Production mode only
*/
if (mix.inProduction()) {
mix
.copy('.vulmix/utils/deploy/.htaccess', '_dist')
} else {
/**
* Development mode
* Development mode only
*/
mix
.serve(
Expand Down
2 changes: 2 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

<meta name="title" content="Your application title">
<meta name="description" content="Your application description">

<link rel="icon" href="/assets/icons/favicon.png">
</Head>

<App />
Expand Down
File renamed without changes
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"autoprefixer": "^10.4.8",
"browser-sync": "^2.27.10",
"browser-sync-webpack-plugin": "^2.3.0",
"fs": "^0.0.1-security",
"laravel-mix": "^6.0.49",
"laravel-mix-ejs": "^2.0.0",
"laravel-mix-replace-in-file": "^0.1.0",
Expand Down

1 comment on commit f8026fd

@vercel
Copy link

@vercel vercel bot commented on f8026fd Oct 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vulmix – ./

vulmix-ojvribeiro.vercel.app
vulmix-git-main-ojvribeiro.vercel.app
vulmix.vercel.app

Please sign in to comment.