@@ -5,43 +5,39 @@ import tsconfigPaths from 'vite-tsconfig-paths'
55import { APP_BASEPATH } from './app/lib/constants.js'
66import path from 'path'
77
8- export default defineConfig ( ( { mode, isSsrBuild } ) => {
9- const isProduction = mode === 'production'
10- const alias : Record < string , string > = {
11- '@/components' : path . resolve (
12- __dirname ,
13- './app/components/redesign/components'
14- ) ,
15- '@/typography' : path . resolve (
16- __dirname ,
17- './app/components/redesign/Typography.tsx'
18- ) ,
19- '@/assets' : path . resolve ( __dirname , './app/assets/svg.tsx' ) ,
20- ...( isProduction && ! isSsrBuild && { crypto : 'crypto-browserify' } )
21- }
22-
23- return {
24- define : {
25- BUILD_CDN_URL : JSON . stringify ( process . env . BUILD_CDN_URL ) ,
26- BUILD_API_URL : JSON . stringify ( process . env . BUILD_API_URL )
27- } ,
28- plugins : [
29- cloudflare ( {
30- persistState : {
31- path : '../.wrangler/v3'
32- }
33- } ) ,
34- reactRouter ( ) ,
35- tsconfigPaths ( )
36- ] ,
37- resolve : {
38- alias
39- } ,
40- build : {
41- assetsDir : `${ APP_BASEPATH . replace ( / ^ \/ / , '' ) } /assets` ,
42- sourcemap : true ,
43- target : 'esnext' ,
44- outDir : 'build'
8+ export default defineConfig ( ( { mode, isSsrBuild } ) => ( {
9+ define : {
10+ BUILD_CDN_URL : JSON . stringify ( process . env . BUILD_CDN_URL ) ,
11+ BUILD_API_URL : JSON . stringify ( process . env . BUILD_API_URL )
12+ } ,
13+ plugins : [
14+ cloudflare ( {
15+ persistState : {
16+ path : '../.wrangler/v3'
17+ }
18+ } ) ,
19+ reactRouter ( ) ,
20+ tsconfigPaths ( )
21+ ] ,
22+ resolve : {
23+ alias : {
24+ '@/components' : path . resolve (
25+ __dirname ,
26+ './app/components/redesign/components'
27+ ) ,
28+ '@/typography' : path . resolve (
29+ __dirname ,
30+ './app/components/redesign/Typography.tsx'
31+ ) ,
32+ '@/assets' : path . resolve ( __dirname , './app/assets/svg.tsx' ) ,
33+ ...( mode === 'production' &&
34+ ! isSsrBuild && { crypto : 'crypto-browserify' } )
4535 }
36+ } ,
37+ build : {
38+ assetsDir : `${ APP_BASEPATH . replace ( / ^ \/ / , '' ) } /assets` ,
39+ sourcemap : true ,
40+ target : 'esnext' ,
41+ outDir : 'build'
4642 }
47- } )
43+ } ) )
0 commit comments