forked from arifszn/gitprofile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec12002
commit 2a30f65
Showing
2 changed files
with
149 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,48 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
import tailwind from 'tailwindcss'; | ||
import autoprefixer from 'autoprefixer'; | ||
import tailwindConfig from './tailwind.config.js'; | ||
import { VitePWA } from 'vite-plugin-pwa'; | ||
import CONFIG from './gitprofile.config'; | ||
import { createHtmlPlugin } from 'vite-plugin-html'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
// If you are deploying to https://<USERNAME>.github.io/, set base to '/'. | ||
// If you are deploying to https://<USERNAME>.github.io/<REPO>/, for example your repository is at https://github.com/<USERNAME>/<REPO>, then set base to '/<REPO>/'. | ||
base: '/portfolio/', | ||
plugins: [react()], | ||
css: { | ||
postcss: { | ||
plugins: [tailwind(tailwindConfig), autoprefixer], | ||
}, | ||
base: CONFIG.base || '/', | ||
plugins: [ | ||
react(), | ||
createHtmlPlugin({ | ||
inject: { | ||
data: { | ||
metaTitle: CONFIG.seo.title, | ||
metaDescription: CONFIG.seo.description, | ||
metaImageURL: CONFIG.seo.imageURL, | ||
}, | ||
}, | ||
}), | ||
...(CONFIG.enablePWA | ||
? [ | ||
VitePWA({ | ||
registerType: 'autoUpdate', | ||
workbox: { | ||
navigateFallback: undefined, | ||
}, | ||
includeAssets: ['logo.png'], | ||
manifest: { | ||
name: 'Portfolio', | ||
short_name: 'Portfolio', | ||
description: 'Personal Portfolio', | ||
icons: [ | ||
{ | ||
src: 'logo.png', | ||
sizes: '64x64 32x32 24x24 16x16 192x192 512x512', | ||
type: 'image/png', | ||
}, | ||
], | ||
}, | ||
}), | ||
] | ||
: []), | ||
], | ||
define: { | ||
CONFIG: CONFIG, | ||
}, | ||
}); | ||
}); |