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.

313 lines
8.0 KiB

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. ],
  95. // Auto import components: https://go.nuxtjs.dev/config-components
  96. components: true,
  97. // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  98. buildModules: [
  99. // https://go.nuxtjs.dev/vuetify
  100. "@nuxtjs/vuetify",
  101. // '@nuxtjs/tailwindcss'
  102. '@nuxt/postcss8',
  103. "@nuxtjs/dotenv",
  104. ],
  105. // Modules: https://go.nuxtjs.dev/config-modules
  106. modules: [
  107. // https://go.nuxtjs.dev/axios
  108. '@nuxtjs/axios',
  109. "@nuxtjs/i18n",
  110. "@nuxtjs/auth-next",
  111. "@nuxtjs/robots",
  112. "nuxt-route-meta",
  113. ["vue-scrollto/nuxt", { duration: 300 }],
  114. ],
  115. // Axios module configuration: https://go.nuxtjs.dev/config-axios
  116. axios: {
  117. // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
  118. // baseURL: 'http://beta.ptcgvip.com',
  119. proxy: true,
  120. // prefix: '/api'
  121. },
  122. proxy: {
  123. '/trending': {
  124. target: 'http://localhost:3466',// 服務地址
  125. pathRewrite: {
  126. '^/trending': '/'
  127. },
  128. changeOrigin: true
  129. }
  130. },
  131. i18n: {
  132. vueI18n: {
  133. silentTranslationWarn: true,
  134. silentFallbackWarn: true,
  135. },
  136. // locales: ["en", "zh-tw"],
  137. defaultLocale: process.env.VUE_APP_I18N_LOCALE || "en",
  138. lazy: true,
  139. langDir: "~/locales/",
  140. locales: [
  141. {
  142. code: "en",
  143. iso: "en-EN",
  144. file: "en.json",
  145. langQuery: "en-US",
  146. title: "English",
  147. text: "English (Global)",
  148. },
  149. {
  150. code: "zh-tw",
  151. iso: "zh-TW",
  152. file: "zh-tw.json",
  153. langQuery: "zh-TW",
  154. title: "繁體中文",
  155. text: "繁體中文(台灣)",
  156. },
  157. ],
  158. },
  159. // 在nuxt.config.js中配置auth
  160. auth: {
  161. strategies: {
  162. local: {
  163. token: {
  164. required: false,
  165. },
  166. user: {
  167. property: "data",
  168. },
  169. endpoints: {
  170. login: {
  171. // url: '/member/users/login',
  172. url: "/trending/api/system/Login",
  173. methods: "post",
  174. },
  175. logout: false,
  176. user: false,
  177. },
  178. },
  179. // 需要使用@nuxtjs/auth-next
  180. facebook: {
  181. endpoints: {
  182. userInfo:
  183. "https://graph.facebook.com/v6.0/me?fields=id,first_name,last_name,email,picture{url}",
  184. },
  185. clientId: "1080300752875237",
  186. scope: ["public_profile", "email"],
  187. },
  188. google: {
  189. clientId:
  190. "707328878971-7prt1v233u2e78e7ugp4sqlso5c2bpk5.apps.googleusercontent.com",
  191. responseType: "token id_token",
  192. codeChallengeMethod: "",
  193. },
  194. },
  195. redirect: {
  196. login: "/user",
  197. callback: "/user/socialCallback",
  198. home: false,
  199. logout: "/",
  200. },
  201. plugins: ["@/plugins/auth-lang-redirect.js"],
  202. localStorage: false,
  203. watchLoggedIn: false,
  204. },
  205. router: {
  206. middleware: ['auth'],
  207. },
  208. // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
  209. vuetify: {
  210. customVariables: ["~/assets/scss/_variables.scss"],
  211. treeShake: true,
  212. theme: {
  213. dark: false,
  214. themes: {
  215. light: {
  216. primary: {
  217. base: "#EE9546",
  218. lighten1: "#F5CDA8",
  219. lighten2: "#F7EDE4",
  220. },
  221. warning: {
  222. base: "#EF5A5A",
  223. lighten1: "#E99E9E",
  224. },
  225. complementary: {
  226. base: "#7997FF",
  227. lighten1: "#F4B927",
  228. },
  229. neutrals: {
  230. base: "#FEFEFE",
  231. darken1: "#F8F8F8",
  232. darken2: "#E5E5E5",
  233. darken3: "#9C9C9C",
  234. darken4: "#504F4F",
  235. darken5: "#232323",
  236. },
  237. },
  238. dark: {
  239. primary: colors.blue.darken2,
  240. accent: colors.grey.darken3,
  241. secondary: colors.amber.darken3,
  242. info: colors.teal.lighten1,
  243. warning: colors.amber.base,
  244. error: colors.deepOrange.accent4,
  245. success: colors.green.accent3,
  246. },
  247. },
  248. },
  249. breakpoint: {
  250. thresholds: {
  251. xs: 390,
  252. sm: 540,
  253. md: 768,
  254. lg: 1280,
  255. xl: 1366,
  256. },
  257. },
  258. },
  259. // 允許爬蟲抓取
  260. robots: {
  261. UserAgent: "*",
  262. Allow: "*",
  263. },
  264. googleFonts: {},
  265. // Build Configuration: https://go.nuxtjs.dev/config-build
  266. build: {
  267. vendor: ['element-ui'],
  268. postcss: {
  269. plugins: {
  270. tailwindcss: {},
  271. autoprefixer: {},
  272. },
  273. },
  274. terser: {
  275. // https://github.com/terser/terser#compress-options
  276. terserOptions: {
  277. compress: {
  278. drop_console: true // 生產環境中禁用console.log
  279. }
  280. }
  281. },
  282. extend (config, { isDev, isClient }) {
  283. config.node = {
  284. fs: 'empty'
  285. }
  286. },
  287. extractCSS: process.env.ENV === 'production',
  288. //html minify
  289. html:{
  290. minify:{
  291. collapseBooleanAttributes: true,
  292. decodeEntities: true,
  293. minifyCSS: true,
  294. minifyJS: true,
  295. processConditionalComments: true,
  296. removeEmptyAttributes: true,
  297. removeRedundantAttributes: true,
  298. trimCustomFragments: true,
  299. useShortDoctype: true,
  300. minifyURLs: true,
  301. removeComments: true,
  302. removeEmptyElements: true
  303. }
  304. },
  305. }
  306. }