인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

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

jarry님의 프로필 이미지
jarry

작성한 질문수

Vue.js - Django 연동 웹 프로그래밍 (실전편)

뷰 폴더 복사하기

FileManagerPlugin 에러

작성

·

382

1

버전이 높아지다보니 호환성이 떨어지는건지... 에러가 계속 나네요....ㅠㅠ

 

FileManagerPlugin에서 onStart.delete 옵션에서 현재 경로 보다 상위경로의 파일을 삭제할수 없다는 오류가 뜹니다.

 

 https://www.npmjs.com/package/filemanager-webpack-plugin

이 사이트 참고해서 아래와 같이 force 옵션을 주어서 해결하긴했는데 강사님께서는 왜 옵션을 안줘도 실행이 된걸까요? 궁금합니다.

configureWebpack: {
plugins: [
new FileManagerPlugin({
events: {
onStart: {
delete: [
{
source: "../backend/static/**/",
options: {
force: true,
},
},
{
source: "../backend/templates/**/",
options: {
force: true,
},
},
],
},

onEnd: {
copy: [
{
source: "dist/static",
destination: "../backend/static/",
},
{
source: "dist/favicon.ico",
destination: "../backend/static/img/",
},
{
source: "dist/home.html",
destination: "../backend/templates/",
},
{
source: "dist/post*.html",
destination: "../backend/templates/blog/",
},
],
},
},
}),
],
},
};

답변 1

1

김석훈님의 프로필 이미지
김석훈
지식공유자

안녕하세요. 독자님.

강의 영상에서는 filemanager-webpack-plugin-fixed 패지지를 사용했습니다.

이 패지키도 오늘 사용해보니 정상 동작하고 있습니다.

좀더 신규 버전인 filemanager-webpack-plugin 을 사용한다면,

이 사이트를 참고해서 ( https://github.com/gregnb/filemanager-webpack-plugin )

아래 처럼 작성해 보세요. 감사합니다.

  configureWebpack: {
    plugins: [
      new FileManagerPlugin({
        events: {
          onStart: {
            delete: [
              '../backend/static/**/',
              '../backend/templates/**/',
            ],
          },

          onEnd: {
            copy: [
              { source: 'dist/static', destination: '../backend/static/' },
              { source: 'dist/favicon.ico', destination: '../backend/static/img/' },
              { source: 'dist/home.html', destination: '../backend/templates/' },
              { source: 'dist/post*.html', destination: '../backend/templates/blog/' },
            ],
          },
        },
      }),
    ]
  },
jarry님의 프로필 이미지
jarry
질문자

감사합니다. django vue 만 알아야 할 게 아니라  여러 플러그인이 모이다 보니 너무 어렵네요....

jarry님의 프로필 이미지
jarry

작성한 질문수

질문하기