Uncaught ReferenceError: require is not defined
조회: 172
댓글: 0개
2023.11.16 15:34 목요일
배경
리액트로 개발하는 동안 App.js에 모든 기능을 다 때려박을 수는 없으니 컴포넌트별로 파일을 분리하기로 했다.
- (static)
- (js)
- (components)
- Test.js
- App.js
- (components)
- (js)
위와 같은 디렉토리를 구성했다.
import Test from "./components/Test.js";
App.js 최상단에 위와 같이 코드를 적어놨더니 에러 뿜는다.
Uncaught ReferenceError: require is not defined
ㅅㅂ 이유가 뭘까?