import colors from "vuetify/es5/util/colors"; import path from 'path'; import fs from 'fs'; export default { // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode loading: false, head: { titleTemplate: "%s│ShowEasy-we make your show easy!", title: "showeasy-v2", htmlAttrs: { lang: "zh-TW", }, meta: [ { charset: "utf-8", }, { name: "viewport", content: "width=device-width, initial-scale=1", }, { hid: "description", name: "description", content: "ShowEasy致力發展一個讓人簡單搜尋、比價、訂購的會展整合平台,讓參展這件事變得不再困難。", }, { hid: "keywords", name: "keywords", content: "ShowEasy,會展,展覽,會展運輸,展覽品運輸,展覽品出口,世貿展覽館", }, { name: "format-detection", content: "telephone=no", }, ], link: [ { rel: "icon", type: "image/x-icon", href: "/favicon.ico", }, { rel: "preconnect", href: "https://fonts.googleapis.com", }, { rel: "preconnect", href: "https://fonts.gstatic.com", }, { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=DM+Sans&display=swap", }, { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Damion&display=swap", }, { rel: "stylesheet", type: "text/css", href: "https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.1.4/swiper-bundle.css", }, ], }, // Global CSS: https://go.nuxtjs.dev/config-css css: [ 'element-ui/lib/theme-chalk/index.css', // '@/assets/css/tailwind.css', "@/assets/css/showeasy-tailwind.css", "@/assets/scss/all.scss", "@/assets/scss/editor.scss", "swiper/swiper-bundle.css", ], render: { resourceHints: true, //啓用預加載 asyncScripts: true }, // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: [ { src: '@/plugins/element-ui', ssr: true }, { src: "~/plugins/axios", ssr: true }, { src: "~/plugins/vueLazyload.js", ssr: false }, { src: "~/plugins/vue-awesome-swiper", ssr: false }, { src: "~/plugins/vue-notification.js", ssr: false }, { src: "~/plugins/vue-unicons", mode: "client" }, { src: "~/plugins/vue-phone-number-input", mode: "client",ssr: false }, { src: "~/plugins/scrollActive", ssr: false }, { src: "~/plugins/vue-js-modal" }, { src: "~/plugins/vue-time-picker", ssr: false }, { src: "~/plugins/ant-design-vue"}, { src: "~/plugins/vue-slider-component", ssr: false }, { src: "~/plugins/vueCompositionAPI" }, { src: "~/plugins/vue-scroll-to" }, { src: "~/plugins/photoswipe", mode: "client", ssr: false }, { src: "~/plugins/plugins-print", mode: "client", ssr: false }, // {src: "~/plugins/storeCache", ssr: false }, // { src: '@/plugins/router', ssr: false} // 先僅用路由前獲取OrgID ], // Auto import components: https://go.nuxtjs.dev/config-components components: true, // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules buildModules: [ // https://go.nuxtjs.dev/vuetify "@nuxtjs/vuetify", // '@nuxtjs/tailwindcss' '@nuxt/postcss8', "@nuxtjs/dotenv", ], // Modules: https://go.nuxtjs.dev/config-modules modules: [ // https://go.nuxtjs.dev/axios '@nuxtjs/axios', "@nuxtjs/i18n", "@nuxtjs/auth-next", "@nuxtjs/robots", "nuxt-route-meta", "cookie-universal-nuxt", ["vue-scrollto/nuxt", { duration: 300 }], ], // Axios module configuration: https://go.nuxtjs.dev/config-axios axios: { // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308 // baseURL: 'http://beta.ptcgvip.com', proxy: true, // prefix: '/api' }, server: { https: { key: fs.readFileSync(path.resolve(__dirname, 'SSL/key_showeasy_com.key')), cert: fs.readFileSync(path.resolve(__dirname, 'SSL/cert_showeasy_com.crt')), } }, proxy: { '/trending': { // target: 'http://www.origtek.com:3002',// 服務地址 target: 'https://showeasy.com:5000',// API 正式機 // target: 'http://showeasy.com:3001',// API 測式機 (無SSL) pathRewrite: { '^/trending': '/' }, changeOrigin: true } }, i18n: { vueI18n: { silentTranslationWarn: true, silentFallbackWarn: true, }, // locales: ["en", "zh-tw"], defaultLocale: process.env.VUE_APP_I18N_LOCALE || "zh-tw", lazy: true, langDir: "~/locales/", locales: [ // { // code: "en", // iso: "en-EN", // file: "en.json", // langQuery: "en-US", // title: "English", // text: "English (Global)", // }, { code: "zh-tw", iso: "zh-TW", file: "zh-tw.json", langQuery: "zh-TW", title: "繁體中文", text: "繁體中文(台灣)", }, ], }, // 在nuxt.config.js中配置auth auth: { strategies: { local: { token: { required: false, }, user: { property: "data", }, endpoints: { login: { // url: '/member/users/login', url: "/trending/api/system/Login", methods: "post", }, logout: false, user: false, }, }, // 需要使用@nuxtjs/auth-next facebook: { endpoints: { userInfo: "https://graph.facebook.com/v6.0/me?fields=id,first_name,last_name,email,picture{url}", }, clientId: "1080300752875237", scope: ["public_profile", "email"], }, google: { clientId: "707328878971-7prt1v233u2e78e7ugp4sqlso5c2bpk5.apps.googleusercontent.com", responseType: "token id_token", codeChallengeMethod: "", }, }, redirect: { login: "/user", callback: "/user/socialCallback", home: false, logout: "/", }, plugins: ["@/plugins/auth-lang-redirect.js"], localStorage: false, watchLoggedIn: false, }, router: { middleware: ['auth'], }, // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify vuetify: { customVariables: ["~/assets/scss/_variables.scss"], treeShake: true, theme: { dark: false, themes: { light: { primary: { base: "#EE9546", lighten1: "#F5CDA8", lighten2: "#F7EDE4", }, warning: { base: "#EF5A5A", lighten1: "#E99E9E", }, complementary: { base: "#7997FF", lighten1: "#F4B927", }, neutrals: { base: "#FEFEFE", darken1: "#F8F8F8", darken2: "#E5E5E5", darken3: "#9C9C9C", darken4: "#504F4F", darken5: "#232323", }, }, dark: { primary: colors.blue.darken2, accent: colors.grey.darken3, secondary: colors.amber.darken3, info: colors.teal.lighten1, warning: colors.amber.base, error: colors.deepOrange.accent4, success: colors.green.accent3, }, }, }, breakpoint: { thresholds: { xs: 390, sm: 540, md: 768, lg: 1280, xl: 1366, }, }, }, // 允許爬蟲抓取 robots: { UserAgent: "*", Allow: "*", }, googleFonts: {}, // Build Configuration: https://go.nuxtjs.dev/config-build build: { vendor: ['element-ui'], postcss: { plugins: { tailwindcss: {}, autoprefixer: {}, }, }, terser: { // https://github.com/terser/terser#compress-options terserOptions: { compress: { drop_console: true // 生產環境中禁用console.log } } }, extend (config, { isDev, isClient }) { config.node = { fs: 'empty' } }, extractCSS: process.env.ENV === 'production', //html minify html:{ minify:{ collapseBooleanAttributes: true, decodeEntities: true, minifyCSS: true, minifyJS: true, processConditionalComments: true, removeEmptyAttributes: true, removeRedundantAttributes: true, trimCustomFragments: true, useShortDoctype: true, minifyURLs: true, removeComments: true, removeEmptyElements: true } }, } }