12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import Components from 'unplugin-vue-components/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- import AutoImport from 'unplugin-auto-import/vite'
- import path from 'path'
- // import {useStoreI18n} from './utils/i18n.js'
- // const { $$t } = useStoreI18n()
- // https://nuxt.com/docs/api/configuration/nuxt-config
- export default defineNuxtConfig({
- compatibilityDate: '2024-11-01',
- devtools: { enabled: true },
- modules: [
- '@nuxtjs/i18n',
- '@element-plus/nuxt'
- ],
-
- alias: {
- // 将 `@css` 映射到 `public/css` 文件夹
- '@': 'assets',
- '~': `${path.resolve(__dirname, 'styles')}/`,
- },
- i18n: {
- locales: ["en","zh"],
- defaultLocale: 'zh',
- strategy: 'no_prefix',
- vueI18n: './i18n.config.ts',
- },
- runtimeConfig: {
- public: {
- baseApi: process.env.VITE_APP_BASE_URL,
- }
- },
- app: {
- head: {
- title: '开心中文',
- meta: [
- {
- name: 'charset',
- content: 'utf-8'
- },
- {
- name: 'viewport',
- content: 'width=device-width,width=1250,maximum-scale=1.0'
- },
- {
- name: 'renderer',
- content: 'webkit'
- }
- ],
- link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
- }
- },
- devServer: {
- port:3002
- },
- vite: {
- css: {
- preprocessorOptions: {
- // 设置你的主题色
- scss: {
- additionalData: `@use "~/element/index.scss" as *; `
- }
- }
- },
- plugins: [
- Components({
- resolvers: [ElementPlusResolver()],
- }),
- AutoImport({
- resolvers: [ElementPlusResolver()],
- }),
- ],
- },
- // css: [
- // '@/css/swiper-bundle.min.css', // 引入 FontAwesome 样式
- // ],
- // build: {
- // transpile: ['@fortawesome/fontawesome-free'], // 确保 FontAwesome 样式和字体文件能够被编译
- // }
- })
|