6bb4719e99
deploy to danak / build_and_deploy (push) Has been cancelled
Replace self-proxy with direct SSR baseURL, rewrite blog post pagination with async/await, pin mongoose-paginate-v2, and add API error logging. Co-authored-by: Cursor <cursoragent@cursor.com>
113 lines
2.6 KiB
JavaScript
113 lines
2.6 KiB
JavaScript
const webpack = require('webpack');
|
|
const nuxtPort = process.env.PORT || 3000
|
|
|
|
export default {
|
|
head: {
|
|
title: 'OrisOxin',
|
|
meta: [
|
|
{ charset: 'utf-8' },
|
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
{ hid: 'description', name: 'description', content: '' }
|
|
],
|
|
link: [
|
|
{ rel: 'icon', type: 'image/png', href: '/favicon.png' },
|
|
{ rel: 'stylesheet', type: 'text/css', href: '/css/bootstrap-grid.min.css' },
|
|
{ rel: 'stylesheet', type: 'text/css', href: '/css/reset-css.css' },
|
|
{ rel: 'stylesheet', type: 'text/css', href: '/css/fontawesome/css/all.min.css' },
|
|
{ rel: 'stylesheet', type: 'text/css', href: '/js/lightBox/simple-lightbox.min.css' }
|
|
],
|
|
script: [{ src: '/js/lightBox/simple-lightbox.min.js' }]
|
|
},
|
|
css: [
|
|
'element-ui/lib/theme-chalk/index.css',
|
|
'slick-carousel/slick/slick.css',
|
|
'slick-carousel/slick/slick-theme.css',
|
|
'@/assets/scss/main.scss'
|
|
],
|
|
plugins: [
|
|
'@/plugins/element-ui',
|
|
'@/plugins/gsap.client',
|
|
'@/plugins/core-ui.client',
|
|
'@/plugins/ckEditor.client',
|
|
'@/plugins/vueNetworkShare'
|
|
],
|
|
components: ['~/components/', { path: '~/components/admin/', prefix: '' }],
|
|
buildModules: ['@nuxtjs/pwa'],
|
|
modules: [
|
|
'@nuxtjs/axios',
|
|
'@nuxtjs/auth-next'
|
|
],
|
|
pwa: {
|
|
manifest: {
|
|
name: 'محاسبه وزن',
|
|
short_name: 'orisOxin cal',
|
|
description: false,
|
|
lang: 'fa',
|
|
useWebmanifestExtension: false,
|
|
start_url: '/fa/pwa'
|
|
},
|
|
meta: {
|
|
mobileAppIOS: true,
|
|
name: 'اریس اکسین'
|
|
},
|
|
workbox: {
|
|
cleanupOutdatedCaches: true
|
|
}
|
|
},
|
|
build: {
|
|
transpile: [/^element-ui/],
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
$: 'jquery',
|
|
jQuery: 'jquery',
|
|
'window.jQuery': 'jquery'
|
|
})
|
|
],
|
|
splitChunks: {
|
|
layouts: true
|
|
},
|
|
babel: {
|
|
plugins: [['@babel/plugin-proposal-private-methods', { loose: true }]]
|
|
},
|
|
},
|
|
|
|
axios: {
|
|
// SSR calls the integrated Express API directly; browser uses relative /api paths.
|
|
proxy: false,
|
|
baseURL: `http://127.0.0.1:${nuxtPort}`,
|
|
browserBaseURL: '/'
|
|
},
|
|
router: {
|
|
linkActiveClass: 'active-link',
|
|
middleware: ['redirects']
|
|
},
|
|
serverMiddleware: ['~/server/index.js'],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: nuxtPort
|
|
},
|
|
|
|
auth: {
|
|
strategies: {
|
|
local: {
|
|
token: {
|
|
property: 'token',
|
|
required: true,
|
|
type: ''
|
|
},
|
|
user: {
|
|
property: 'user',
|
|
autoFetch: true
|
|
},
|
|
endpoints: {
|
|
login: { url: '/api/auth/login', method: 'post' },
|
|
logout: { url: '/api/auth/logout', method: 'delete' },
|
|
user: { url: '/api/auth/user', method: 'get' }
|
|
}
|
|
}
|
|
},
|
|
redirect: false
|
|
},
|
|
|
|
}
|