Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): make use of favicon more flexible #55

Merged
merged 5 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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