강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

neostgeart님의 프로필 이미지
neostgeart

작성한 질문수

웹 게임을 만들며 배우는 React

2-9. 웹팩 데브 서버와 핫 리로딩

webpack.config.js에서 devServer 프로퍼티 질문이 있습니다.

작성

·

5K

1

output: {
path: path.join(__dirname, "dist"),
filename: "app.js",
publicPath: "/dist/",
},

devServer: {
publicPath: "/dist/",
hot: true,
},

이렇게 하고 패키지도 전부 정상적으로 설치했는데 자꾸 다음과 같은 에러가 뜹니다 혹시 무엇이 문제일가요?ㅠㅠ

[webpack-cli] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

 - options has an unknown property 'publicPath'. These properties are valid:

   object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, setupExitSignals?, static?, watchFiles?, webSocketServer? }

퀴즈

React에서 Class Component 대신 Functional Component와 함께 Hooks를 사용하는 주된 이유는 무엇일까요?

Class Component의 문법이 너무 복잡해서

상태 관리(`setState`)와 Ref 사용을 함수형 컴포넌트에서도 가능하게 하려고

Class Component보다 무조건 성능이 좋아서

React Router와 더 잘 통합되어서

답변 2

1

publicPath 지우시면 됩니다. publicPath 속성은 이제 사용되지 않는것으로 보입니다.

0

neostgeart님의 프로필 이미지
neostgeart
질문자

와 감사합니다ㅠ

neostgeart님의 프로필 이미지
neostgeart

작성한 질문수

질문하기