Skip to content

Commit

Permalink
fix: tree shaking mock data (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTK committed Jun 28, 2021
1 parent 4761b2d commit e374770
Show file tree
Hide file tree
Showing 6 changed files with 6,253 additions and 6,100 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_USE_MOCK=0
2 changes: 1 addition & 1 deletion src/components/MenuList/MenuList.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { Story, Meta } from '@storybook/react';
import { PureMenuList, MenuListProps } from 'src/components/MenuList';
import shopInfo from 'src/mocks/shop-sample.json';
import shopInfo from 'src/mocks/shop-sample';

export default {
title: 'Molecule/MenuList',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/api-mock.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IEventInfo, ISelectedMenu } from 'src/store/types';
import { FirestoreDocRef } from 'src/types/common';
import { IShopInfo } from 'src/types/baemin';
import shopSample from 'src/mocks/shop-sample.json';
import shopSample from 'src/mocks/shop-sample';

const sampleEvent: IEventInfo = {
title: '샘플 식사 이벤트',
Expand Down
1 change: 0 additions & 1 deletion src/lib/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import apiReal from './api';
import apiMock from './api-mock';

// TODO: 트리쉐이킹 되게 수정
export default process.env.REACT_APP_USE_MOCK === '1' ? apiMock : apiReal;
Loading

0 comments on commit e374770

Please sign in to comment.