切换编译为传统的webpack

This commit is contained in:
niyyzf 2024-08-03 13:15:41 +08:00
parent 6d41883288
commit c84f3f6f0e
1 changed files with 68 additions and 67 deletions

View File

@ -1,22 +1,23 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
import AutoImport from 'unplugin-auto-import/vite' import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite' import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' import {NaiveUiResolver} from 'unplugin-vue-components/resolvers'
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: {enabled: true}, devtools: {enabled: true},
ssr: false, builder: "webpack",
modules: [ ssr: false,
'@nuxtjs/color-mode', modules: [
'@hypernym/nuxt-gsap', '@nuxtjs/color-mode',
"@nuxtjs/google-fonts", '@hypernym/nuxt-gsap',
'nuxt-lucide-icons', "@nuxtjs/google-fonts",
'@pinia/nuxt', 'nuxt-lucide-icons',
'@pinia-plugin-persistedstate/nuxt', '@pinia/nuxt',
"@vueuse/nuxt", '@pinia-plugin-persistedstate/nuxt',
"nuxtjs-naive-ui" "@vueuse/nuxt",
], "nuxtjs-naive-ui"
],
vite: { vite: {
plugins: [ plugins: [
AutoImport({ AutoImport({
@ -36,65 +37,65 @@ export default defineNuxtConfig({
}) })
] ]
}, },
// pwa: { // pwa: {
// manifest: { // manifest: {
// name: "pwa nuxt 3", // name: "pwa nuxt 3",
// short_name: "pwa nuxt", // short_name: "pwa nuxt",
// theme_color: '#FFFFFF', // theme_color: '#FFFFFF',
// description: "Arman Abi r.man.abi@gmail.com", // description: "Arman Abi r.man.abi@gmail.com",
// icons: [{ // icons: [{
// src: '/pwa-192x192.png', sizes: "192x192", type: "image/png" // src: '/pwa-192x192.png', sizes: "192x192", type: "image/png"
// },] // },]
// //
// //
// }, workbox: { // }, workbox: {
// navigateFallback: "/SignIn", // navigateFallback: "/SignIn",
// //
// }, devOptions: { // }, devOptions: {
// enabled: true, type: "module" // enabled: true, type: "module"
// } // }
// //
// }, // },
gsap: { gsap: {
autoImport: true, autoImport: true,
extraPlugins: { extraPlugins: {
text: true text: true
} }
}, },
css: ['assets/min.scss', 'vue-toastification/dist/index.css'], css: ['assets/min.scss', 'vue-toastification/dist/index.css'],
devServer: { devServer: {
port: 3001, host: '0.0.0.0', port: 3001, host: '0.0.0.0',
// https: { // https: {
// key: "./localhost+3-key.pem", // key: "./localhost+3-key.pem",
// cert: "./localhost+3.pem", // cert: "./localhost+3.pem",
// } // }
}, },
plugins: [ plugins: [
{src: '~/plugins/vue-toast.ts'}, {src: '~/plugins/vue-toast.ts'},
{src: '~/plugins/apexcharts.ts'}, {src: '~/plugins/apexcharts.ts'},
], ],
runtimeConfig: { runtimeConfig: {
baseUrl: '', public: { baseUrl: '', public: {
apiBase: '/Api', baseUrl: process.env.NUXT_API_URL apiBase: '/Api', baseUrl: process.env.NUXT_API_URL
} }
}, },
googleFonts: { googleFonts: {
families: { families: {
Roboto: true, 'Josefin+Sans': true, Lato: [100, 300], Raleway: { Roboto: true, 'Josefin+Sans': true, Lato: [100, 300], Raleway: {
wght: [100, 400], ital: [100] wght: [100, 400], ital: [100]
}, Inter: '200..700', 'Crimson Pro': { }, Inter: '200..700', 'Crimson Pro': {
wght: '200..900', ital: '200..700', wght: '200..900', ital: '200..700',
}, 'Noto Sans SC': { }, 'Noto Sans SC': {
wght: '200..900', ital: '200..700' wght: '200..900', ital: '200..700'
} }
} }
}, },
compatibilityDate: '2024-07-21', compatibilityDate: '2024-07-21',
}) })