강의

멘토링

커뮤니티

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của gkwoduf07
gkwoduf07

câu hỏi đã được viết

Vue.js - Lập trình web liên kết với Django (phiên bản thực tế)

Máy chủ phát triển Webpack

devServer 설정 에러가 납니다.

Viết

·

2K

0

devServer: {
index: 'home.html',
},

위와 같이 설정 시에 아래처럼 index라는 옵션이 없다고 뜨는데 왜그러는걸까요...?

강의영상 시간 : 3:06

---------------------------------------- 

ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.

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

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

vuejsdjangoVuetify

Câu trả lời 4

1

bestdjango님의 프로필 이미지
bestdjango
Người chia sẻ kiến thức

안녕하세요. 독자님.

webpack-dev-server 버전 4.x 에서는 옵션이 바뀌었군요.

아래처럼 해 보세요.

  devServer: {

    static: {
      staticOptions: {
        index: 'home.html',
      },
    },

 }

감사합니다.

0

bestdjango님의 프로필 이미지
bestdjango
Người chia sẻ kiến thức

안녕하세요. 독자님.

아래 사이트에서 참고했습니다.

https://webpack.kr/configuration/dev-server/#devserverstatic

감사합니다.

0

저도 동일한 에러메세지로 한참 구글링을 했습니다.

이렇게 변경 된 내용은 어디서 다큐먼트를 참조 하면 될까요 ?

0

bestdjango님의 프로필 이미지
bestdjango
Người chia sẻ kiến thức

독자님.

한줄 더 추가해야 정확하겠군요. (Webpack v5 / webpack-dev-server v4 이상에서)

const path = require('path');
  
  devServer: {
    static: {
      directory: path.join(__dirname, 'dist'),
      staticOptions: {
        index: 'home.html',
      },
    },
  },
Hình ảnh hồ sơ của gkwoduf07
gkwoduf07

câu hỏi đã được viết

Đặt câu hỏi