Files
ostandari/nuxt.config.js
T
Hamidreza Eidy 94500faf79 add otp form
2024-11-18 10:48:19 +00:00

184 lines
4.7 KiB
JavaScript

const webpack = require("webpack");
const serverPort = 3756;
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: "پورتال خبری استانداری",
htmlAttrs: {
lang: "fa",
},
meta: [
{ charset: "utf-8" },
{
name: "viewport",
content: "width=device-width, initial-scale=1",
},
{ name: "theme-color", content: "#000" },
{
hid: "description",
name: "description",
content: "استانداری مرکزی",
},
],
link: [
{
rel: "icon",
type: "image/x-icon",
href: "/favicon.png",
},
{
rel: "stylesheet",
type: "text/css",
href: "/js/lightBox/simple-lightbox.min.css",
},
{
rel: "stylesheet",
type: "text/css",
href: "/js/flipBook/flipbook.style.css",
},
{
rel: "stylesheet",
type: "text/css",
href: "/js/flipBook/font-awesome.css",
},
{ rel: 'stylesheet',
href: 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js' }
],
script: [
{ src: "https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js" },
{ src: "https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" },
{ src: "/js/flipBook/flipbook.min.js" },
{ src: "/js/lightBox/simple-lightbox.min.js" },
{ src: 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', defer: true },
{ src: 'https://cdnjs.cloudflare.com/ajax/libs/jquery-flipbook/1.0.5/jquery.flipbook.min.js', defer: true }
],
},
loading: "~/components/pageLoad.vue",
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
"element-ui/lib/theme-chalk/index.css",
"~/assets/css/bootstrap-grid.css",
"~/assets/css/reset-css.css",
"~/assets/css/fontawesome/css/all.min.css",
"~/assets/scss/main.scss",
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
"@/plugins/element-ui",
"@/plugins/gsap.client",
"@/plugins/core-ui.client",
"@/plugins/ckEditor.client",
"@/plugins/datePicker.client",
{ src: "@/plugins/jquery.js", mode: "client" },
{
src: "@/plugins/vue-turnjs.client", // Added vue-turnjs plugin
mode: "client",
},
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: [
"~/components/",
{ path: "~/components/admin/", prefix: "" },
],
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
"@nuxtjs/axios",
"@nuxtjs/auth-next",
"vue-social-sharing/nuxt",
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
proxy: true,
},
proxy: {
"/api": { target: `http://0.0.0.0:${serverPort}` },
},
serverMiddleware: ["~/server/index.js"],
server: {
host: "0.0.0.0",
port: 3000,
},
router: {
middleware: ["redirects"],
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
transpile: [/^element-ui/],
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
],
splitChunks: {
layouts: true,
},
},
auth: {
strategies: {
local: {
token: {
property: "token",
required: true,
type: "",
},
user: {
property: "user",
autoFetch: true,
},
endpoints: {
login: { url: "/api/otp/verify", method: "post" },
logout: {
url: "/api/auth/logout",
method: "delete",
},
user: { url: "/api/auth/user", method: "get" },
},
},
vote: {
scheme: "local",
token: {
property: "token",
required: true,
type: "",
},
user: {
property: "user",
autoFetch: true,
},
endpoints: {
login: {
url: "/api/auth/voter/login",
method: "post",
},
user: {
url: "/api/auth/voter/user",
method: "get",
},
logout: false,
},
tokenRequired: true,
tokenType: "",
globalToken: true,
},
},
redirect: false,
},
};