2017-03-07 4 views
0

를 사용 bower_components에서 리소스를로드하는 데 실패와 JS 파일는 CSS를 참조 할 때 나는 다음과 같은 오류가 발생 내 프로젝트에서 Vue.js CLI

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://localhost:8080/bower_components/bootstrap/dist/css/bootstrap.min.css 

이것은 내 파일 구조

app 
    |bower_components 
     |bootstrap 
      |dist 
       |css 
        | bootstrap.min.css 
     |jquery 
      |dist 
       |jquery.min.js 
    |build 
    |config 
    |node_modules 
    |src 
    |static 
    |index.html //The file I am receiving error on 
public //using Slim framework with PHP to generate RESTful API 
src 
vendor 

입니다 내 index.html 파일 다음 코드를 사용하여 bootstrap.min.css 파일을 참조하려고합니다.

<!DOCTYPE html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <title>Template</title> 
    <link rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap.min.css"> 
    </head> 
    <body> 
    <div id="app"></div> 
    </body> 
</html> 

Visual Studio Code를 사용하고 있습니다.이 파일을 사용하면 bootstrap.min.css 파일에 대한 링크를 CTRL + 클릭하여로드 할 수 있습니다. 그러면로드가 잘되어 어디에서 잘못되었는지 알 수 있습니까?

나는 app 폴더로 vue.js CLI를 사용하고 도움이 경우 public/src/vendor 폴더에서 편안하고 API를 생성하는 PHPSlim Framework을 사용하고? 어떤 도움이라도 대단히 감사하겠습니다.

+0

같은 파일을 참조하는 데 필요한? – Aaron

+0

@Aaron 예, 여전히 같은 오류가 발생합니다. 나는 단지 vue.js CLI를 사용하여 시험해 보았고 작동하기 때문에 분명히 그 일과 관련이있다. – mcclosa

답변

0

이 문제를 해결할 수 있었으며 Vue.js CLI를 사용하여이 문제를 해결할 수있었습니다.

나는 정적 폴더에 bower_components 폴더를 추가 한 다음 당신은 "./"링크에서 제거 시도 해 봤나

<link rel="stylesheet" href="./static/bower_components/bootstrap/dist/css/bootstrap.min.css">