代码拉取完成,页面将自动刷新
同步操作将从 Carl/nuxt3-template 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
// https://nuxt.com/docs/api/configuration/nuxt-config
// import AutoImport from 'unplugin-auto-import/vite'
// import Components from 'unplugin-vue-components/vite'
// import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import pkg from './package.json'
console.table([{
version: pkg.version,
mode: process.env.NODE_ENV,
}])
const {
NUXT_PUBLIC_API_BASEURL,
NUXT_PUBLIC_COOKIE_DOMAIN,
NUXT_PUBLIC_COOKIE_PATH,
NUXT_PUBLIC_COOKIE_SAMESITE,
NUXT_PUBLIC_DELETE_CONSOLE,
NUXT_PUBLIC_TITLE,
NUXT_PUBLIC_PREFIX,
} = import.meta.env
console.table({
NUXT_PUBLIC_API_BASEURL,
NUXT_PUBLIC_COOKIE_DOMAIN,
NUXT_PUBLIC_COOKIE_PATH,
NUXT_PUBLIC_COOKIE_SAMESITE,
NUXT_PUBLIC_DELETE_CONSOLE,
NUXT_PUBLIC_TITLE,
NUXT_PUBLIC_PREFIX,
})
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
typescript: { strict: false, shim: false },
imports: { dirs: ['types', 'stores', 'api'] },
app: {
head: {
title: import.meta.env.NUXT_PUBLIC_TITLE,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no' },
{ name: 'keywords', content: '网站,后台,开发,外包,服务,公司,官网' },
{ name: 'description', content: '春花,秋月,夏日,冬雪。你若盛开,清风自来。心若浮沉,浅笑安然。' },
{ name: 'format-detection', content: 'telephone=no' },
// pc 等比例缩放
// { name: 'viewport', content: 'user-scalable=yes' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
// <p class="ql-editor" v-html="info.content"></p>
{ rel: 'stylesheet', href: '//cdn.quilljs.com/1.3.6/quill.core.css' },
{ rel: 'stylesheet', href: '//cdn.quilljs.com/1.3.6/quill.snow.css' },
{ rel: 'stylesheet', href: '//cdn.quilljs.com/1.3.6/quill.bubble.css' },
],
style: [],
script: [
// { src: '//cdn.jsdelivr.net/npm/eruda', type: 'text/javascript' },
// { children: 'eruda.init();', type: 'text/javascript' }
],
noscript: [{ children: 'JavaScript is required' }],
},
},
modules: [
'@vueuse/nuxt',
'@unocss/nuxt',
'dayjs-nuxt',
'@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt',
],
dayjs: {
plugins: ['duration', 'relativeTime'],
locales: ['en', 'zh-cn'],
defaultLocale: ['zh-cn', {
relativeTime: {
future: '刚刚',
past: '%s前',
s: '几秒',
m: '1 分钟',
mm: '%d 分钟',
h: '1 小时',
hh: '%d 小时',
d: '1 天',
dd: '%d 天',
M: '1 个月',
MM: '%d 个月',
y: '1 年',
yy: '%d 年',
},
}],
},
build: { transpile: [/echarts/] },
unocss: {
nuxtLayers: true,
},
css: ['@unocss/reset/normalize.css', '@unocss/reset/sanitize/sanitize.css', '@unocss/reset/sanitize/assets.css', '~/assets/scss/element/main.scss', '~/assets/scss/index.scss'],
vite: {
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "~/assets/scss/element/index.scss" as element;`,
},
},
},
build: {
// chunkSizeWarningLimit: 2000,
commonjsOptions: { transformMixedEsModules: true },
},
esbuild: {
drop: import.meta.env.NUXT_PUBLIC_DELETE_CONSOLE === 'true' ? ['console', 'debugger'] : [],
},
},
piniaPersistedstate: {
cookieOptions: {
domain: NUXT_PUBLIC_COOKIE_DOMAIN,
path: NUXT_PUBLIC_COOKIE_PATH,
sameSite: NUXT_PUBLIC_COOKIE_SAMESITE,
},
},
runtimeConfig: {
version: pkg.version,
public: {
version: pkg.version,
title: NUXT_PUBLIC_TITLE,
prefix: NUXT_PUBLIC_PREFIX,
api: {
baseUrl: NUXT_PUBLIC_API_BASEURL,
},
},
},
devServer: {
// https: {
// key: fs.readFileSync(path.resolve(__dirname, 'server.key'), 'utf-8'),
// cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'), 'utf-8')
// }
},
nitro: NUXT_PUBLIC_PREFIX
? {
devProxy: {
[NUXT_PUBLIC_PREFIX]: {
target: NUXT_PUBLIC_API_BASEURL,
changeOrigin: true,
secure: false,
ws: true,
prependPath: true,
},
},
routeRules: {
[`${NUXT_PUBLIC_PREFIX}/**`]: {
proxy: `${NUXT_PUBLIC_API_BASEURL}/**`,
},
},
}
: {},
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。