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.

314 lines
8.0 KiB

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