Skip to content

Commit

Permalink
Merge pull request #43 from ojvribeiro/fix-ejs-hashing
Browse files Browse the repository at this point in the history
fix(core): allow file path hashing in `watch` mode
  • Loading branch information
ojvribeiro committed Sep 27, 2022
2 parents 0e9a684 + de44f4f commit 89562d9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
35 changes: 21 additions & 14 deletions .vulmix/mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ class VulmixInit {
},
})

.ejs('index.ejs', '_dist')
.ejs(
['index.ejs', '_dist/mix-manifest.json'],
'_dist',
{},
{
base: '_dist',
partials: ['_dist/mix-manifest.json'],
mixVersioning: true,
}
)

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

Expand All @@ -47,18 +56,16 @@ class VulmixInit {

.extract()

.after(stats => {
mix.imgs({
source: 'assets/img',
destination: '_dist/assets/img',
webp: true,
thumbnailsSizes: [1920, 1200, 900, 600, 300, 50],
smallerThumbnailsOnly: true,
thumbnailsOnly: true,
imageminWebpOptions: {
quality: 90,
},
})
.imgs({
source: 'assets/img',
destination: '_dist/assets/img',
webp: true,
thumbnailsSizes: [1920, 1200, 900, 600, 300, 50],
smallerThumbnailsOnly: true,
thumbnailsOnly: true,
imageminWebpOptions: {
quality: 90,
},
})

/**
Expand All @@ -73,7 +80,7 @@ class VulmixInit {
*/
mix
.serve(
'npx http-server -p 8000 -a localhost _dist -c-1 --gzip --proxy http://localhost:8000?',
'npx http-server -p 8000 -a localhost _dist --gzip --proxy http://localhost:8000?',
{
verbose: false,
build: false,
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"main": "index.js",
"scripts": {
"create-img-dir": "mkdirp _dist/assets/img",
"remove-dist": "rimraf _dist",
"remove-dist": "rimraf _dist/assets/_vulmix _dist/assets/css _dist/assets/js",
"build": "npm run remove-dist && npm run create-img-dir && mix",
"dev": "npm run remove-dist && npm run create-img-dir && mix watch",
"hot": "npm run remove-dist && npm run create-img-dir && mix watch --hot",
"serve": "npx http-server -p 8000 -a localhost _dist -c-1 --gzip --proxy http://localhost:8000?",
"serve": "npx http-server -p 8000 -a localhost _dist --gzip --proxy http://localhost:8000?",
"prod": "npm run remove-dist && npm run create-img-dir && mix --production"
},
"author": "Victor Ribeiro",
Expand Down

1 comment on commit 89562d9

@vercel
Copy link

@vercel vercel bot commented on 89562d9 Sep 27, 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.vercel.app
vulmix-git-main-ojvribeiro.vercel.app

Please sign in to comment.