From 178ce9db7a6a4023f197a3090e22ec210655e48e Mon Sep 17 00:00:00 2001 From: cebgcontract <99630598+cebgcontract@users.noreply.github.com> Date: Thu, 29 Sep 2022 19:44:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=80=E4=BA=9B=E9=93=BE?= =?UTF-8?q?=E6=8E=A5,=20cookie=E4=BA=8C=E7=BA=A7=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E5=85=B1=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- .../@walletconnect+browser-utils+1.7.5.patch | 8 +- src/assets/main/card/class_4.png | Bin 0 -> 3032 bytes src/components/index/DesktopFooter.vue | 18 +- src/components/market/TopMenu.vue | 2 +- src/components/mobile/main/MobileFooter.vue | 18 +- src/router/index.ts | 353 ++++++------------ src/utils/cookies.ts | 4 +- vue.config.js | 40 +- 9 files changed, 169 insertions(+), 276 deletions(-) create mode 100644 src/assets/main/card/class_4.png diff --git a/package.json b/package.json index a70cbb7..32d0a6d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build:test": "vue-cli-service build --mode test", "deploy:prod": "rm -f ./dist/.DS_Store && aws s3 sync ./dist s3://cebg.games --exclude \"pubgv4/*\" --exclude \"release/*\"", "deploy:test": "rm -f ./dist/.DS_Store && aws s3 sync ./dist s3://test-client.cebg.games", - "refresh:prod": "aws cloudfront create-invalidation --distribution-id E34PEY4AGTMS0Y --paths \"/*\"", + "refresh:prod": "aws cloudfront create-invalidation --distribution-id E3L3EZ5PQ5MDAU --paths \"/*\"", "refresh:test": "aws cloudfront create-invalidation --distribution-id EE4HC9OXEQC7Y --paths \"/*\"", "svg": "vsvg -s ./src/icons/svg -t ./src/icons/components --ext ts --es6", "sitemap": "vue-cli-service sitemap" diff --git a/patches/@walletconnect+browser-utils+1.7.5.patch b/patches/@walletconnect+browser-utils+1.7.5.patch index e8e97c6..5e54023 100644 --- a/patches/@walletconnect+browser-utils+1.7.5.patch +++ b/patches/@walletconnect+browser-utils+1.7.5.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/@walletconnect/browser-utils/dist/esm/local.js b/node_modules/@walletconnect/browser-utils/dist/esm/local.js -index c7f4db3..66b8863 100644 +index c7f4db3..9e2d455 100644 --- a/node_modules/@walletconnect/browser-utils/dist/esm/local.js +++ b/node_modules/@walletconnect/browser-utils/dist/esm/local.js -@@ -1,26 +1,31 @@ +@@ -1,26 +1,29 @@ import { safeJsonParse, safeJsonStringify } from "./json"; import { getLocalStorage } from "./browser"; +var Cookies = require('js-cookie') @@ -12,9 +12,7 @@ index c7f4db3..66b8863 100644 - if (local) { - local.setItem(key, raw); - } -+ console.log('cookie save vale: ' + key + ' | ' + raw); -+ console.log(Cookies); -+ Cookies.set(key, raw); ++ Cookies.set(key, raw, { domain: 'cebg.games'}); + // const local = getLocalStorage(); + // if (local) { + // local.setItem(key, raw); diff --git a/src/assets/main/card/class_4.png b/src/assets/main/card/class_4.png new file mode 100644 index 0000000000000000000000000000000000000000..fcdfd34ed30efb29646081c508ddd9b9529aedea GIT binary patch literal 3032 zcmV;}3n%o6P)~U0006gP)t-s00000 zKR*CVO8{0@04*&>)4~96Zvlmc0C;!+VqyU$B?6R`05&!Pj*S3mX^_$M0v;X!e}4m` zq5>5b0}l`YTwDRYy^YZFM$^Ips;U6W$^o{v0I;wDnVC@2$pXW}1fHIY(eVV>*mvRY z0@T!x(e#he^pMf?5a;F>wX=WI>IU815~!yErlyb6^djo$P2SHE>*@*4&X3UZ3gY1e z&CLgki)^5~A@J`aytx;oqAc|CCRJYC{rukh`xM2*Nz=qg)5J*A!vo^tYNftxq`xt0 zc6|2p2h{oqJ)zT@=%2L(KFZcBp-rW?>%^APG z5U{T!<>Pql^Mu0V9k{l6w9#Gi>VER@E${3Y^6?ez?2g#<8PU)s!@-Eh=!59=JY;fz z@a<#L)+F`xA@uSk+t`fO^n$_b!2J0< z;@)-A;*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qg3!ILloBl``tp8x**d4Pl$qqHIF7i*B~mb0iG;p z0j4qu!WrMB(L~g!YFL122#$$J%BB&;mBm!~onO%S&`(J)d3awE(}?2ADq}4EMPdjE zqT!z;q`!2~*T`?(J)vxOnHVbcdc9>38%Rtx2K~HD3h&AnM^4c=eG^ex%?;Z=v6RPt zh}rreAC_uk`-|u6myx)6^DUyXdVK7IF>)->#F)JCVC->-n`_p*MO0S5|7#$MYX5(Y a5kCL}v1ELLyCOOO0000
Resources
@@ -31,13 +31,13 @@
About
- Team - Roadmap + Team + Roadmap
Contact us
diff --git a/src/components/market/TopMenu.vue b/src/components/market/TopMenu.vue index 62bdde4..295605e 100644 --- a/src/components/market/TopMenu.vue +++ b/src/components/market/TopMenu.vue @@ -10,7 +10,7 @@
- Home - Gameplay - Tokenomic - NFT - Marketplace + Home + Gameplay + Tokenomic + NFT + Marketplace
@@ -38,16 +38,16 @@
About
plus
- Team - Roadmap + Team + Roadmap
diff --git a/src/router/index.ts b/src/router/index.ts index ecae65a..a192d5a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,313 +1,208 @@ -import Vue from 'vue' -import VueRouter, { RouteConfig } from 'vue-router' -import { AppModule, DeviceType } from '@/store/modules/app' -import { isMobile } from '@/utils/resize' +import Vue from "vue"; +import VueRouter, { RouteConfig } from "vue-router"; +import { AppModule, DeviceType } from "@/store/modules/app"; +import { isMobile } from "@/utils/resize"; -Vue.use(VueRouter) -const mobile = isMobile() +Vue.use(VueRouter); +const mobile = isMobile(); if (mobile) { - AppModule.ToggleDevice(DeviceType.Mobile) + AppModule.ToggleDevice(DeviceType.Mobile); } -console.log('AppModule.device: ', AppModule.device, mobile) +console.log("AppModule.device: ", AppModule.device, mobile); const routes: Array = [ { - path: '/', - name: 'Main', - component: resolve => mobile ? require(['@/views/mobile/Index.vue'], resolve) : require(['@/views/desktop/Index.vue'], resolve), - alias: '/index.html', - meta: { - title: 'CEBG: CRYPTO ELITE‘S BATTLEGROUNDS', - metaTags: [ - { - name: 'description', - content: 'CEBG is the 1st Anime + Beauties + Mechas blockchain game that supports FREE TO PLAY and PLAY TO EARN. It\'s an online multiplayer battle royale game where up to 40 players parachute onto an island and scavenge for weapons and equipment to kill others. The last player or team standing wins the round.' - }, - { - name: 'keywords', - content: 'CEBG, CRYPTO ELITE‘S BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITE‘S, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game' - } - ] - } - }, - { - path: '/market', - name: 'Market', - component: resolve => mobile ? require(['@/views/mobile/Market.vue'], resolve) : require(['@/views/desktop/Market.vue'], resolve), + path: "/", + name: "Market", + component: (resolve) => + mobile + ? require(["@/views/mobile/Market.vue"], resolve) + : require(["@/views/desktop/Market.vue"], resolve), //component: resolve => require(['@/views/desktop/Market.vue'], resolve), meta: { - title: 'Market | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Market | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/official', - name: 'Official', - component: resolve => require(['@/views/desktop/Official.vue'], resolve) + path: "/official", + name: "Official", + component: (resolve) => require(["@/views/desktop/Official.vue"], resolve), }, { - path: '/mall', - name: 'Mall', - component: resolve => require(['@/views/desktop/Mall.vue'], resolve), + path: "/mall", + name: "Mall", + component: (resolve) => require(["@/views/desktop/Mall.vue"], resolve), meta: { - title: 'Mall | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Mall | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/mysteryboxes', - name: 'Mystery', - component: resolve => require(['@/views/desktop/Mystery.vue'], resolve), + path: "/mysteryboxes", + name: "Mystery", + component: (resolve) => require(["@/views/desktop/Mystery.vue"], resolve), meta: { - title: 'Mystery Boxes | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Mystery Boxes | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/eventreward', - name: 'EventReward', - component: resolve => require(['@/views/desktop/EventReward.vue'], resolve), + path: "/eventreward", + name: "EventReward", + component: (resolve) => + require(["@/views/desktop/EventReward.vue"], resolve), meta: { - title: 'Event Reward | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Event Reward | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/presale', - name: 'Presale', - component: resolve => require(['@/views/desktop/Presale.vue'], resolve), + path: "/presale", + name: "Presale", + component: (resolve) => require(["@/views/desktop/Presale.vue"], resolve), meta: { - title: 'Presale | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Presale | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, // beforeEnter(to, from, next) { // window.location.href = 'https://test.cebg.games/presale' // } }, { - path: '/mynft', - name: 'MyNft', - component: resolve => require(['@/views/desktop/MyNft.vue'], resolve), + path: "/mynft", + name: "MyNft", + component: (resolve) => require(["@/views/desktop/MyNft.vue"], resolve), meta: { - title: 'MyNft | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "MyNft | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/wallet', - name: 'Wallet', - component: resolve => require(['@/views/desktop/Wallet.vue'], resolve), + path: "/wallet", + name: "Wallet", + component: (resolve) => require(["@/views/desktop/Wallet.vue"], resolve), meta: { - title: 'Wallet | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Wallet | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/account', - name: 'Account', - component: resolve => require(['@/views/desktop/AccountSetting.vue'], resolve), + path: "/account", + name: "Account", + component: (resolve) => + require(["@/views/desktop/AccountSetting.vue"], resolve), meta: { - title: 'Account | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "Account | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/item/:id', - name: 'Item', - component: resolve => require(['@/views/desktop/Item.vue'], resolve), + path: "/item/:id", + name: "Item", + component: (resolve) => require(["@/views/desktop/Item.vue"], resolve), meta: { - title: 'NFT Info | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS' - } + title: "NFT Info | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS", + }, }, { - path: '/nft', - name: 'Nft', - // component: mobile ? MobileNft : NFT, - component: resolve => mobile ? require(['@/views/mobile/NFT.vue'], resolve) : require(['@/views/desktop/NFT.vue'], resolve), - alias: '/nft/index.html', + path: "/nativelogin", + name: "NativeLogin", + component: (resolve) => + require(["@/views/mobile/NativeLogin.vue"], resolve), meta: { - title: 'NFT | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS', - metaTags: [ - { - name: 'description', - content: 'CEBG is the 1st Anime + Beauties + Mechas blockchain game that supports FREE TO PLAY and PLAY TO EARN. It\'s an online multiplayer battle royale game where up to 40 players parachute onto an island and scavenge for weapons and equipment to kill others. The last player or team standing wins the round.' - }, - { - name: 'keywords', - content: 'nft, CEBG, CRYPTO ELITE‘S BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITE‘S, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game' - } - ] - } + title: "NativeLogin", + nofont: "true", + }, }, { - path: '/gameplay', - name: 'Gameplay', - component: resolve => mobile ? require(['@/views/mobile/Gameplay.vue'], resolve) : require(['@/views/desktop/Gameplay.vue'], resolve), - alias: '/gameplay/index.html', + path: "/privacy", + name: "Privacy", + component: (resolve) => + require(["@/views/desktop/PrivacyPolicy.vue"], resolve), meta: { - title: 'Gameplay | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS', - metaTags: [ - { - name: 'description', - content: 'CEBG is the 1st Anime + Beauties + Mechas blockchain game that supports FREE TO PLAY and PLAY TO EARN. It\'s an online multiplayer battle royale game where up to 40 players parachute onto an island and scavenge for weapons and equipment to kill others. The last player or team standing wins the round.' - }, - { - name: 'keywords', - content: 'gameplay, CEBG, CRYPTO ELITE‘S BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITE‘S, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game' - } - ] - } + title: "Privacy Policy of Crypto Elite's:BATTLEGROUNDS (CEBG)", + }, }, - { - path: '/tokenomic', - name: 'Tokenomic', - component: resolve => mobile ? require(['@/views/mobile/Tokenomic.vue'], resolve) : require(['@/views/desktop/Tokenomic.vue'], resolve), - alias: '/tokenomic/index.html', - meta: { - title: 'Tokenomic | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS', - metaTags: [ - { - name: 'description', - content: 'CEBG is the 1st Anime + Beauties + Mechas blockchain game that supports FREE TO PLAY and PLAY TO EARN. It\'s an online multiplayer battle royale game where up to 40 players parachute onto an island and scavenge for weapons and equipment to kill others. The last player or team standing wins the round.' - }, - { - name: 'keywords', - content: 'tokenomic, CEBG, CRYPTO ELITE‘S BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITE‘S, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game' - } - ] - } - }, - { - path: '/team', - name: 'Team', - component: resolve => mobile ? require(['@/views/mobile/Team.vue'], resolve) : require(['@/views/desktop/Team.vue'], resolve), - alias: '/team/index.html', - meta: { - title: 'Team | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS', - metaTags: [ - { - name: 'description', - content: 'CEBG is the 1st Anime + Beauties + Mechas blockchain game that supports FREE TO PLAY and PLAY TO EARN. It\'s an online multiplayer battle royale game where up to 40 players parachute onto an island and scavenge for weapons and equipment to kill others. The last player or team standing wins the round.' - }, - { - name: 'keywords', - content: 'team, CEBG, CRYPTO ELITE‘S BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITE‘S, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game' - } - ] - } - }, - { - path: '/roadmap', - name: 'Roadmap', - component: resolve => mobile ? require(['@/views/mobile/Roadmap.vue'], resolve) : require(['@/views/desktop/Roadmap.vue'], resolve), - alias: '/roadmap/index.html', - meta: { - title: 'Roadmap | CEBG: CRYPTO ELITE‘S BATTLEGROUNDS', - metaTags: [ - { - name: 'description', - content: 'CEBG is the 1st Anime + Beauties + Mechas blockchain game that supports FREE TO PLAY and PLAY TO EARN. It\'s an online multiplayer battle royale game where up to 40 players parachute onto an island and scavenge for weapons and equipment to kill others. The last player or team standing wins the round.' - }, - { - name: 'keywords', - content: 'roadmap, CEBG, CRYPTO ELITE‘S BATTLEGROUNDS, CEBG BATTLEGROUNDS, CE BATTLEGROUNDS, CRYPTO ELITE‘S, cebg Mobile, cebg official, free battle royale, cebg game, cec, ceg, cebg coin, cebg gold, cebg crypto, cebg p2e, play to earn, free to play, blockchain game' - } - ] - } - }, - { - path: '/nativelogin', - name: 'NativeLogin', - component: resolve => require(['@/views/mobile/NativeLogin.vue'], resolve), - meta: { - title: 'NativeLogin', - nofont: 'true' - } - }, - { - path: '/privacy', - name: 'Privacy', - component: resolve => require(['@/views/desktop/PrivacyPolicy.vue'], resolve), - meta: { - title: 'Privacy Policy of Crypto Elite\'s:BATTLEGROUNDS (CEBG)' - } - }, - { - path: '/terms', - name: 'Terms', - component: resolve => require(['@/views/desktop/Terms.vue'], resolve), - meta: { - title: 'Crypto Elite\'s: BATTLEGROUNDS(CEBG) Terms of Use' - } - } -] +]; const router = new VueRouter({ - mode: 'history', + mode: "history", base: process.env.BASE_URL, - routes -}) + routes, +}); // ... const FONT_ATTRS = [ { - rel: 'preconnect', - href: 'https://fonts.googleapis.com' + rel: "preconnect", + href: "https://fonts.googleapis.com", }, { - rel: 'preconnect', - href: 'https://fonts.gstatic.com', - crossorigin: '' + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossorigin: "", }, { - rel: 'stylesheet', - href: 'https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;700&display=swap' - } -] + rel: "stylesheet", + href: "https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;700&display=swap", + }, +]; // This callback runs before every route change, including on page load. router.beforeEach((to, from, next) => { // This goes through the matched routes from last to first, finding the closest route with a title. // e.g., if we have `/some/deep/nested/route` and `/some`, `/deep`, and `/nested` have titles, // `/nested`'s will be chosen. - const nearestWithTitle = to.matched.slice().reverse().find(r => r.meta && r.meta.title) + const nearestWithTitle = to.matched + .slice() + .reverse() + .find((r) => r.meta && r.meta.title); - const noFont = to.matched.slice().find(r => r.meta && r.meta.nofont) + const noFont = to.matched.slice().find((r) => r.meta && r.meta.nofont); // Find the nearest route element with meta tags. - const nearestWithMeta = to.matched.slice().reverse().find(r => r.meta && r.meta.metaTags) + const nearestWithMeta = to.matched + .slice() + .reverse() + .find((r) => r.meta && r.meta.metaTags); - const previousNearestWithMeta = from.matched.slice().reverse().find(r => r.meta && r.meta.metaTags) + const previousNearestWithMeta = from.matched + .slice() + .reverse() + .find((r) => r.meta && r.meta.metaTags); // If a route with a title was found, set the document (page) title to that value. if (nearestWithTitle) { - document.title = nearestWithTitle.meta.title + document.title = nearestWithTitle.meta.title; } else if (previousNearestWithMeta) { - document.title = previousNearestWithMeta.meta.title + document.title = previousNearestWithMeta.meta.title; } // Remove any stale meta tags from the document using the key attribute we set below. - Array.from(document.querySelectorAll('[data-vue-router-controlled]')).map((el: any) => el.parentNode.removeChild(el)) - const createDomToHeader = function(name: string, datas: any) { - const tag = document.createElement(name) + Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map( + (el: any) => el.parentNode.removeChild(el) + ); + const createDomToHeader = function (name: string, datas: any) { + const tag = document.createElement(name); - Object.keys(datas).forEach(key => { - tag.setAttribute(key, datas[key]) - }) + Object.keys(datas).forEach((key) => { + tag.setAttribute(key, datas[key]); + }); // We use this to track which meta tags we create so we don't interfere with other ones. - tag.setAttribute('data-vue-router-controlled', '') + tag.setAttribute("data-vue-router-controlled", ""); - return tag - } + return tag; + }; if (!noFont) { FONT_ATTRS.map((tagDef: any) => { - return createDomToHeader('link', tagDef) - }) - .forEach((tag: any) => document.head.appendChild(tag)) + return createDomToHeader("link", tagDef); + }).forEach((tag: any) => document.head.appendChild(tag)); } // Skip rendering meta tags if there are none. - if (!nearestWithMeta) return next() + if (!nearestWithMeta) return next(); // Turn the meta tag definitions into actual elements in the head. - nearestWithMeta.meta.metaTags.map((tagDef: any) => { - return createDomToHeader('meta', tagDef) - }) + nearestWithMeta.meta.metaTags + .map((tagDef: any) => { + return createDomToHeader("meta", tagDef); + }) // Add the meta tags to the document head. - .forEach((tag: any) => document.head.appendChild(tag)) + .forEach((tag: any) => document.head.appendChild(tag)); - next() -}) + next(); +}); -export default router +export default router; diff --git a/src/utils/cookies.ts b/src/utils/cookies.ts index 8797482..bc60468 100644 --- a/src/utils/cookies.ts +++ b/src/utils/cookies.ts @@ -24,9 +24,9 @@ const tokenKey = 'vue_typescript_access_token' // export const removeItem = (key: string) => localStorage.removeItem(key) export const getToken = () => Cookies.get(tokenKey) -export const setToken = (token: string) => Cookies.set(tokenKey, token) +export const setToken = (token: string) => Cookies.set(tokenKey, token, { domain: 'cebg.games'}) export const removeToken = () => Cookies.remove(tokenKey) export const getItem = (key: string) => Cookies.get(key) -export const setItem = (key: string, val: string) => Cookies.set(key, val) +export const setItem = (key: string, val: string) => Cookies.set(key, val, { domain: 'cebg.games'}) export const removeItem = (key: string) => Cookies.remove(key) diff --git a/vue.config.js b/vue.config.js index 7286c0a..a432ec2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -36,25 +36,25 @@ module.exports = { }) }, configureWebpack(config) { - if (process.env.NODE_ENV === 'production') { - config.plugins.push( - new PrerenderSPAPlugin({ - indexPath: path.resolve('dist/index.html'), - staticDir: path.resolve('dist'), - routes: ['/', '/nft', '/gameplay', '/tokenomic', '/roadmap', '/team'], - renderer: new Renderer({ - headless: true, - defaultViewport: { - width: 1920, - height: 1080 - } - }), - postProcess(renderedRoute) { - renderedRoute.html = renderedRoute.html.replace(YOUTUBE_WIDGET_SCRIPT, '').replace(YOUTUBE_PLAYER_SCRIPT, '') - return renderedRoute - } - }) - ) - } + // if (process.env.NODE_ENV === 'production') { + // config.plugins.push( + // new PrerenderSPAPlugin({ + // indexPath: path.resolve('dist/index.html'), + // staticDir: path.resolve('dist'), + // routes: ['/', '/nft', '/gameplay', '/tokenomic', '/roadmap', '/team'], + // renderer: new Renderer({ + // headless: true, + // defaultViewport: { + // width: 1920, + // height: 1080 + // } + // }), + // postProcess(renderedRoute) { + // renderedRoute.html = renderedRoute.html.replace(YOUTUBE_WIDGET_SCRIPT, '').replace(YOUTUBE_PLAYER_SCRIPT, '') + // return renderedRoute + // } + // }) + // ) + // } } }