refactor code to nuxt and add ssr and edit some text in landing
This commit is contained in:
+100
@@ -0,0 +1,100 @@
|
||||
import { createRequire } from 'node:module'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { resolve } from 'node:path'
|
||||
import { defineNuxtConfig } from 'nuxt/config'
|
||||
|
||||
const srcDir = fileURLToPath(new URL('./src', import.meta.url))
|
||||
const require = createRequire(import.meta.url)
|
||||
/** Vite در SSR بهاشتباه browser entry را میگیرد و به window.FormData میزند */
|
||||
const formDataNodeEntry = require.resolve('form-data')
|
||||
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2024-11-01',
|
||||
srcDir: 'src/',
|
||||
ssr: true,
|
||||
|
||||
app: {
|
||||
baseURL: '/landing/',
|
||||
head: {
|
||||
htmlAttrs: {
|
||||
lang: 'fa',
|
||||
dir: 'rtl',
|
||||
},
|
||||
meta: [
|
||||
{ charset: 'utf-8' },
|
||||
{ name: 'enamad', content: '44889195' },
|
||||
{
|
||||
name: 'viewport',
|
||||
content:
|
||||
'width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content',
|
||||
},
|
||||
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
|
||||
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
|
||||
],
|
||||
link: [
|
||||
{ rel: 'icon', type: 'image/png', href: '/landing/favicon.png' },
|
||||
{ rel: 'shortcut icon', type: 'image/png', href: '/landing/favicon.png' },
|
||||
{ rel: 'apple-touch-icon', href: '/landing/favicon.png' },
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
loginAppUrl:
|
||||
process.env.NUXT_PUBLIC_LOGIN_APP_URL ||
|
||||
process.env.VITE_LOGIN_APP_URL ||
|
||||
'https://app.boursemes.com/home',
|
||||
},
|
||||
},
|
||||
|
||||
css: [
|
||||
'@/assets/css/landing-entry.less',
|
||||
'@unocss/reset/tailwind-compat.css',
|
||||
],
|
||||
|
||||
modules: ['@pinia/nuxt', '@unocss/nuxt'],
|
||||
|
||||
vite: {
|
||||
resolve: {
|
||||
alias: {
|
||||
'form-data': formDataNodeEntry,
|
||||
},
|
||||
},
|
||||
ssr: {
|
||||
external: ['form-data'],
|
||||
resolve: {
|
||||
conditions: ['node', 'import', 'module', 'default'],
|
||||
externalConditions: ['node', 'import', 'module', 'default'],
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
modifyVars: {
|
||||
hack: `; @import (reference) "${resolve(srcDir, 'assets/css/var.less').replace(/\\/g, '/')}";`,
|
||||
},
|
||||
javascriptEnabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
typescript: {
|
||||
typeCheck: false,
|
||||
strict: false,
|
||||
},
|
||||
|
||||
nitro: {
|
||||
compressPublicAssets: true,
|
||||
},
|
||||
|
||||
experimental: {
|
||||
payloadExtraction: false,
|
||||
},
|
||||
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 3200,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user