From a2a22c618e3234d82e7416c768f12407ffae0288 Mon Sep 17 00:00:00 2001 From: 37b7 Date: Mon, 19 May 2025 17:07:07 +0200 Subject: [PATCH] change tactic --- config/paths.ts | 68 ++++++++++++++++++++++++------------------------- nuxt.config.ts | 38 ++++++++------------------- vite.config.js | 31 ++++++++++++++++++++++ 3 files changed, 76 insertions(+), 61 deletions(-) create mode 100644 vite.config.js diff --git a/config/paths.ts b/config/paths.ts index 2033810..811c961 100644 --- a/config/paths.ts +++ b/config/paths.ts @@ -4,67 +4,67 @@ import { withBasePath } from './basePath'; export const PATHS = { IMAGES: { PROJECTS: { - TEMP: withBasePath('/assets/images/temp_project.png'), - PORTFOLIO: withBasePath('/assets/images/portfolionuxt_project.png'), - IRIS: withBasePath('/assets/images/iris_project.png'), - CHROMINO: withBasePath('/assets/images/chromino_project.png'), - CLAVIER: withBasePath('/assets/images/clavier_project.png'), - FLOUFACE: withBasePath('/assets/images/flouface_project.png'), - MODELISATION: withBasePath('/assets/images/modelisation_project.png'), - SERVER: withBasePath('/assets/images/server_project.png') + TEMP: withBasePath('assets/images/temp_project.png'), + PORTFOLIO: withBasePath('assets/images/portfolionuxt_project.png'), + IRIS: withBasePath('assets/images/iris_project.png'), + CHROMINO: withBasePath('assets/images/chromino_project.png'), + CLAVIER: withBasePath('assets/images/clavier_project.png'), + FLOUFACE: withBasePath('assets/images/flouface_project.png'), + MODELISATION: withBasePath('assets/images/modelisation_project.png'), + SERVER: withBasePath('assets/images/server_project.png') }, GALLERY: { PORTFOLIO: [ - withBasePath('/assets/images/gallery/portfolio/portfolio_1.jpg'), - withBasePath('/assets/images/gallery/portfolio/portfolio_2.jpg'), - withBasePath('/assets/images/gallery/portfolio/portfolio_3.jpg') + withBasePath('assets/images/gallery/portfolio/portfolio_1.jpg'), + withBasePath('assets/images/gallery/portfolio/portfolio_2.jpg'), + withBasePath('assets/images/gallery/portfolio/portfolio_3.jpg') ], IRIS: [ - withBasePath('/assets/images/gallery/iris/iris_1.jpg'), - withBasePath('/assets/images/gallery/iris/iris_2.jpg') + withBasePath('assets/images/gallery/iris/iris_1.jpg'), + withBasePath('assets/images/gallery/iris/iris_2.jpg') ], CHROMINO: [ - withBasePath('/assets/images/gallery/chromino/chromino_1.jpg'), - withBasePath('/assets/images/gallery/chromino/chromino_2.jpg') + withBasePath('assets/images/gallery/chromino/chromino_1.jpg'), + withBasePath('assets/images/gallery/chromino/chromino_2.jpg') ], CLAVIER: [ - withBasePath('/assets/images/gallery/clavier/clavier_1.jpg'), - withBasePath('/assets/images/gallery/clavier/clavier_2.jpg') + withBasePath('assets/images/gallery/clavier/clavier_1.jpg'), + withBasePath('assets/images/gallery/clavier/clavier_2.jpg') ], MODELISATION: [ - withBasePath('/assets/images/gallery/modelisation/modelisation_1.jpg'), - withBasePath('/assets/images/gallery/modelisation/modelisation_2.jpg') + withBasePath('assets/images/gallery/modelisation/modelisation_1.jpg'), + withBasePath('assets/images/gallery/modelisation/modelisation_2.jpg') ], SERVER: [ - withBasePath('/assets/images/gallery/server/server_1.jpg'), - withBasePath('/assets/images/gallery/server/server_2.jpg') + withBasePath('assets/images/gallery/server/server_1.jpg'), + withBasePath('assets/images/gallery/server/server_2.jpg') ], FLOUFACE: [ - withBasePath('/assets/images/gallery/flouface/flouface_1.jpg'), - withBasePath('/assets/images/gallery/flouface/flouface_2.jpg') + withBasePath('assets/images/gallery/flouface/flouface_1.jpg'), + withBasePath('assets/images/gallery/flouface/flouface_2.jpg') ] } }, ICONS: { GITHUB: { - LIGHT: withBasePath('/assets/icons/github-black.png'), - DARK: withBasePath('/assets/icons/github-white.png') + LIGHT: withBasePath('assets/icons/github-black.png'), + DARK: withBasePath('assets/icons/github-white.png') } as Icons, DEMO: { - LIGHT: withBasePath('/assets/icons/demo-black.png'), - DARK: withBasePath('/assets/icons/demo-white.png') + LIGHT: withBasePath('assets/icons/demo-black.png'), + DARK: withBasePath('assets/icons/demo-white.png') } as Icons, DOCUMENTATION: { - LIGHT: withBasePath('/assets/icons/documentation-black.png'), - DARK: withBasePath('/assets/icons/documentation-white.png') + LIGHT: withBasePath('assets/icons/documentation-black.png'), + DARK: withBasePath('assets/icons/documentation-white.png') } as Icons, YOUTUBE: { - LIGHT: withBasePath('/assets/icons/youtube-black.png'), - DARK: withBasePath('/assets/icons/youtube-white.png') + LIGHT: withBasePath('assets/icons/youtube-black.png'), + DARK: withBasePath('assets/icons/youtube-white.png') } as Icons }, RESOURCES: { - CV: withBasePath('/assets/files/CV_final_Mathéo_Thierry.pdf') + CV: withBasePath('assets/files/CV_final_Mathéo_Thierry.pdf') }, LINKS: { YOUTUBE: 'https://www.youtube.com/@37b7', @@ -106,6 +106,6 @@ export const PATHS = { } as const; export const DEFAULT_IMAGES = { - PROJECT: withBasePath('/assets/images/default-project.png'), - ICON: withBasePath('/assets/icons/default-icon.png'), + PROJECT: withBasePath('assets/images/default-project.png'), + ICON: withBasePath('assets/icons/default-icon.png'), } as const; \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index 1ec821d..5182708 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,17 +1,16 @@ // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ - compatibilityDate: '2024-11-01', devtools: { enabled: true }, css: [ - '~/assets/css/theme.css', - '~/assets/css/common.css', - '~/assets/css/header.css', - '~/assets/css/footer.css', - '~/assets/css/pages/home.css', - '~/assets/css/pages/projects.css', - '~/assets/css/pages/about.css', - '~/assets/css/pages/cv.css' + 'assets/css/theme.css', + 'assets/css/common.css', + 'assets/css/header.css', + 'assets/css/footer.css', + 'assets/css/pages/home.css', + 'assets/css/pages/projects.css', + 'assets/css/pages/about.css', + 'assets/css/pages/cv.css' ], app: { @@ -31,23 +30,14 @@ export default defineNuxtConfig({ ], }, buildAssetsDir: '/_nuxt/', - }, - - routeRules: { - '/**': { ssr: true } - }, - - router: { - options: { - strict: false - } + cdnURL: process.env.NODE_ENV === 'production' ? 'https://codefirst.iut.uca.fr' : '', }, modules: ['@nuxt/image'], plugins: [ - { src: '~/plugins/router.ts', mode: 'client' }, - { src: '~/plugins/theme.ts', mode: 'client' } + { src: 'plugins/router.ts', mode: 'server' }, + { src: 'plugins/theme.ts', mode: 'client' } ], image: { @@ -71,12 +61,6 @@ export default defineNuxtConfig({ }, }, - nitro: { - routeRules: { - '/**': { cors: true } - } - }, - runtimeConfig: { public: { basePath: process.env.NODE_ENV === 'production' ? '/containers/matheothierry-portfolio_nuxt' : '/' diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..5383088 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,31 @@ +import { defineConfig } from 'vite' +import { fileURLToPath } from 'url' +import { dirname, resolve } from 'path' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = dirname(__filename) + +// https://vitejs.dev/config/ +export default defineConfig({ + base: process.env.NODE_ENV === 'production' ? '/containers/matheothierry-portfolio_nuxt/' : '/', + resolve: { + alias: { + '@': resolve(__dirname, './'), + '~': resolve(__dirname, './') + } + }, + server: { + host: '0.0.0.0', + port: 3000 + }, + build: { + assetsDir: '_nuxt', + rollupOptions: { + output: { + manualChunks: { + 'vendor': ['vue', 'vue-router'] + } + } + } + } +})