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.

316 lines
8.2 KiB

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