You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

327 lines
8.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. import colors from "vuetify/es5/util/colors";
  2. import path from 'path';
  3. import fs from 'fs';
  4. export default {
  5. // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
  6. loading: false,
  7. head: {
  8. titleTemplate: "%s│ShowEasy-we make your show easy!",
  9. title: "showeasy-v2",
  10. htmlAttrs: {
  11. lang: "zh-TW",
  12. },
  13. meta: [
  14. {
  15. charset: "utf-8",
  16. },
  17. {
  18. name: "viewport",
  19. content: "width=device-width, initial-scale=1",
  20. },
  21. {
  22. hid: "description",
  23. name: "description",
  24. content:
  25. "ShowEasy致力發展一個讓人簡單搜尋、比價、訂購的會展整合平台,讓參展這件事變得不再困難。",
  26. },
  27. {
  28. hid: "keywords",
  29. name: "keywords",
  30. content: "ShowEasy,會展,展覽,會展運輸,展覽品運輸,展覽品出口,世貿展覽館",
  31. },
  32. {
  33. name: "format-detection",
  34. content: "telephone=no",
  35. },
  36. ],
  37. link: [
  38. {
  39. rel: "icon",
  40. type: "image/x-icon",
  41. href: "/favicon.ico",
  42. },
  43. {
  44. rel: "preconnect",
  45. href: "https://fonts.googleapis.com",
  46. },
  47. {
  48. rel: "preconnect",
  49. href: "https://fonts.gstatic.com",
  50. },
  51. {
  52. rel: "stylesheet",
  53. href: "https://fonts.googleapis.com/css2?family=DM+Sans&display=swap",
  54. },
  55. {
  56. rel: "stylesheet",
  57. href: "https://fonts.googleapis.com/css2?family=Damion&display=swap",
  58. },
  59. {
  60. rel: "stylesheet",
  61. type: "text/css",
  62. href: "https://cdnjs.cloudflare.com/ajax/libs/Swiper/8.1.4/swiper-bundle.css",
  63. },
  64. ],
  65. },
  66. // Global CSS: https://go.nuxtjs.dev/config-css
  67. css: [
  68. 'element-ui/lib/theme-chalk/index.css',
  69. // '@/assets/css/tailwind.css',
  70. "@/assets/css/showeasy-tailwind.css",
  71. "@/assets/scss/all.scss",
  72. "@/assets/scss/editor.scss",
  73. "swiper/swiper-bundle.css",
  74. ],
  75. render: {
  76. resourceHints: true, //啓用預加載
  77. asyncScripts: true
  78. },
  79. // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  80. plugins: [
  81. { src: '@/plugins/element-ui', ssr: true },
  82. { src: "~/plugins/axios", ssr: true },
  83. { src: "~/plugins/vueLazyload.js", ssr: false },
  84. { src: "~/plugins/vue-awesome-swiper", ssr: false },
  85. { src: "~/plugins/vue-notification.js", ssr: false },
  86. { src: "~/plugins/vue-unicons", mode: "client" },
  87. { src: "~/plugins/vue-phone-number-input", mode: "client",ssr: false },
  88. { src: "~/plugins/scrollActive", ssr: false },
  89. { src: "~/plugins/vue-js-modal" },
  90. { src: "~/plugins/vue-time-picker", ssr: false },
  91. { src: "~/plugins/ant-design-vue"},
  92. { src: "~/plugins/vue-slider-component", ssr: false },
  93. { src: "~/plugins/vueCompositionAPI" },
  94. { src: "~/plugins/vue-scroll-to" },
  95. { src: "~/plugins/photoswipe", mode: "client", ssr: false },
  96. { src: "~/plugins/plugins-print", mode: "client", ssr: false },
  97. // {src: "~/plugins/storeCache", ssr: false },
  98. // { src: '@/plugins/router', ssr: false} // 先僅用路由前獲取OrgID
  99. ],
  100. // Auto import components: https://go.nuxtjs.dev/config-components
  101. components: true,
  102. // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  103. buildModules: [
  104. // https://go.nuxtjs.dev/vuetify
  105. "@nuxtjs/vuetify",
  106. // '@nuxtjs/tailwindcss'
  107. '@nuxt/postcss8',
  108. "@nuxtjs/dotenv",
  109. ],
  110. // Modules: https://go.nuxtjs.dev/config-modules
  111. modules: [
  112. // https://go.nuxtjs.dev/axios
  113. '@nuxtjs/axios',
  114. "@nuxtjs/i18n",
  115. "@nuxtjs/auth-next",
  116. "@nuxtjs/robots",
  117. "nuxt-route-meta",
  118. "cookie-universal-nuxt",
  119. ["vue-scrollto/nuxt", { duration: 300 }],
  120. ],
  121. // Axios module configuration: https://go.nuxtjs.dev/config-axios
  122. axios: {
  123. // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
  124. // baseURL: 'http://beta.ptcgvip.com',
  125. proxy: true,
  126. // prefix: '/api'
  127. },
  128. server: {
  129. https: {
  130. key: fs.readFileSync(path.resolve(__dirname, 'SSL/key_showeasy_com.key')),
  131. cert: fs.readFileSync(path.resolve(__dirname, 'SSL/cert_showeasy_com.crt')),
  132. }
  133. },
  134. proxy: {
  135. '/trending': {
  136. // target: 'http://www.origtek.com:3002',// 服務地址
  137. target: 'https://showeasy.com:5000',// API 正式機
  138. // target: 'http://showeasy.com:3001',// API 測式機 (無SSL)
  139. pathRewrite: {
  140. '^/trending': '/'
  141. },
  142. changeOrigin: true
  143. }
  144. },
  145. i18n: {
  146. vueI18n: {
  147. silentTranslationWarn: true,
  148. silentFallbackWarn: true,
  149. },
  150. // locales: ["en", "zh-tw"],
  151. defaultLocale: process.env.VUE_APP_I18N_LOCALE || "zh-tw",
  152. lazy: true,
  153. langDir: "~/locales/",
  154. locales: [
  155. // {
  156. // code: "en",
  157. // iso: "en-EN",
  158. // file: "en.json",
  159. // langQuery: "en-US",
  160. // title: "English",
  161. // text: "English (Global)",
  162. // },
  163. {
  164. code: "zh-tw",
  165. iso: "zh-TW",
  166. file: "zh-tw.json",
  167. langQuery: "zh-TW",
  168. title: "繁體中文",
  169. text: "繁體中文(台灣)",
  170. },
  171. ],
  172. },
  173. // 在nuxt.config.js中配置auth
  174. auth: {
  175. strategies: {
  176. local: {
  177. token: {
  178. required: false,
  179. },
  180. user: {
  181. property: "data",
  182. },
  183. endpoints: {
  184. login: {
  185. // url: '/member/users/login',
  186. url: "/trending/api/system/Login",
  187. methods: "post",
  188. },
  189. logout: false,
  190. user: false,
  191. },
  192. },
  193. // 需要使用@nuxtjs/auth-next
  194. facebook: {
  195. endpoints: {
  196. userInfo:
  197. "https://graph.facebook.com/v6.0/me?fields=id,first_name,last_name,email,picture{url}",
  198. },
  199. clientId: "1080300752875237",
  200. scope: ["public_profile", "email"],
  201. },
  202. google: {
  203. clientId:
  204. "707328878971-7prt1v233u2e78e7ugp4sqlso5c2bpk5.apps.googleusercontent.com",
  205. responseType: "token id_token",
  206. codeChallengeMethod: "",
  207. },
  208. },
  209. redirect: {
  210. login: "/user",
  211. callback: "/user/socialCallback",
  212. home: false,
  213. logout: "/",
  214. },
  215. plugins: ["@/plugins/auth-lang-redirect.js"],
  216. localStorage: false,
  217. watchLoggedIn: false,
  218. },
  219. router: {
  220. middleware: ['auth'],
  221. },
  222. // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
  223. vuetify: {
  224. customVariables: ["~/assets/scss/_variables.scss"],
  225. treeShake: true,
  226. theme: {
  227. dark: false,
  228. themes: {
  229. light: {
  230. primary: {
  231. base: "#EE9546",
  232. lighten1: "#F5CDA8",
  233. lighten2: "#F7EDE4",
  234. },
  235. warning: {
  236. base: "#EF5A5A",
  237. lighten1: "#E99E9E",
  238. },
  239. complementary: {
  240. base: "#7997FF",
  241. lighten1: "#F4B927",
  242. },
  243. neutrals: {
  244. base: "#FEFEFE",
  245. darken1: "#F8F8F8",
  246. darken2: "#E5E5E5",
  247. darken3: "#9C9C9C",
  248. darken4: "#504F4F",
  249. darken5: "#232323",
  250. },
  251. },
  252. dark: {
  253. primary: colors.blue.darken2,
  254. accent: colors.grey.darken3,
  255. secondary: colors.amber.darken3,
  256. info: colors.teal.lighten1,
  257. warning: colors.amber.base,
  258. error: colors.deepOrange.accent4,
  259. success: colors.green.accent3,
  260. },
  261. },
  262. },
  263. breakpoint: {
  264. thresholds: {
  265. xs: 390,
  266. sm: 540,
  267. md: 768,
  268. lg: 1280,
  269. xl: 1366,
  270. },
  271. },
  272. },
  273. // 允許爬蟲抓取
  274. robots: {
  275. UserAgent: "*",
  276. Allow: "*",
  277. },
  278. googleFonts: {},
  279. // Build Configuration: https://go.nuxtjs.dev/config-build
  280. build: {
  281. vendor: ['element-ui'],
  282. postcss: {
  283. plugins: {
  284. tailwindcss: {},
  285. autoprefixer: {},
  286. },
  287. },
  288. terser: {
  289. // https://github.com/terser/terser#compress-options
  290. terserOptions: {
  291. compress: {
  292. drop_console: true // 生產環境中禁用console.log
  293. }
  294. }
  295. },
  296. extend (config, { isDev, isClient }) {
  297. config.node = {
  298. fs: 'empty'
  299. }
  300. },
  301. extractCSS: process.env.ENV === 'production',
  302. //html minify
  303. html:{
  304. minify:{
  305. collapseBooleanAttributes: true,
  306. decodeEntities: true,
  307. minifyCSS: true,
  308. minifyJS: true,
  309. processConditionalComments: true,
  310. removeEmptyAttributes: true,
  311. removeRedundantAttributes: true,
  312. trimCustomFragments: true,
  313. useShortDoctype: true,
  314. minifyURLs: true,
  315. removeComments: true,
  316. removeEmptyElements: true
  317. }
  318. },
  319. }
  320. }