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.

318 lines
8.3 KiB

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