File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,12 @@ jobs:
2525 npm install tailwindcss@latest postcss@latest autoprefixer@latest
2626 npm install --save-dev @types/node
2727
28+ - name : Create .env file # env 파일 생성 단계 추가
29+ run : |
30+ echo "VITE_GA_MEASUREMENT_ID=${{ secrets.VITE_GA_MEASUREMENT_ID }}" > .env
31+
2832 - name : Run build
2933 run : npm run build --verbose # 프로젝트에 맞는 빌드 명령어
30- env :
31- VITE_GA_MEASUREMENT_ID : ${{ secrets.VITE_GA_MEASUREMENT_ID }} # Google Analytics 환경 변수 사용
3234
3335 - name : Docker build & push
3436 run : |
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import ReactGA from "react-ga4";
22
33const GA_MEASUREMENT_ID = import . meta. env . VITE_GA_MEASUREMENT_ID || "" ;
44
5- const isProduction = process . env . NODE_ENV === "production" ;
5+ const isProduction = import . meta . env . MODE === "production" ;
66
77const initGA = ( ) => {
88 if ( isProduction && GA_MEASUREMENT_ID ) {
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ export default defineConfig(({ mode }: { mode: string }) => {
1919 strictPort : true ,
2020 allowedHosts : [ "mbtips.kr" ] ,
2121 hmr : isProduction
22- ? false // 배포 환경에서는 HMR 비활성화 (WebSocket 사용 안 함)
22+ ? {
23+ host : "mbtips.kr" ,
24+ protocol : "wss"
25+ }
2326 : {
2427 host : "localhost" ,
2528 protocol : "wss"
@@ -60,11 +63,6 @@ export default defineConfig(({ mode }: { mode: string }) => {
6063 replacement : path . resolve ( __dirname , "src/libs" )
6164 }
6265 ]
63- } ,
64- define : {
65- "process.env.VITE_GA_MEASUREMENT_ID" : JSON . stringify (
66- process . env . VITE_GA_MEASUREMENT_ID
67- )
6866 }
6967 } ;
7068} ) ;
You can’t perform that action at this time.
0 commit comments