2016-08-08 8 views
1

저는 거의 새로운 각도이고 저는 Angular2 프로젝트에서 작업 중입니다. 브런치에 다음과 같은 CSS 파일을 추가하고 싶습니다. 구문은 무엇입니까? brunch-config.js 또는 index.html에 추가하는 것이 더 좋습니까?브런치에 여러 스타일 시트 추가하기

파일 :

'/app/assets/css/bootstrap.css', 

'/app/assets/css/custom.css', 

'/app/assets/css/font-awesome.css', 

'http://fonts.googleapis.com/css?family=Open+Sans' 

브런치-config.js : 당신은 평소와 같이 @import CSS에서 규칙 또는 <link> HTML 요소를 사용하여 글꼴을 가져올 수 있습니다

exports.config = { 
    // See http://brunch.io/#documentation for docs. 
    files: { 
    javascripts: { 
     joinTo: { 
     'vendor.js': /^node_modules/, 
     'main.js': /^app/ 
     }, 
     order: { 
     after: [/\.html$/, /\.css$/] 
     } 
    }, 
    stylesheets: { 
     joinTo: 'app.css' 
    }, 
    templates: { 
     joinTo: 'main.js' 
    } 
    }, 
    plugins: { 
    inlineCss: { 
     html: true, 
     passthrough: [/^node_modules/, 'app/global.css'] 
    } 
    } 
}; 

답변

1

. 다른 파일을 추가하려면 app/styles 디렉토리에 저장하십시오. 그들이 지금 사용되지 않는 이유는 그들이 assets 폴더에 있기 때문입니다. 정적 자산 (예 : 템플릿) 만 배치하십시오. 이 파일들은 app.css에 합류됩니다. 스타일 시트를 HTML로 링크했는지 확인하십시오.

또한 this skeleton은 각도 2 앱을 부트 스트랩하는 데 유용 할 수 있습니다.

+0

이 파일을 index.html 문서에 추가하면이 오류가 발생합니다. SourceMap을 파싱하지 못했습니다. http : // localhost : 3333/app.styles.map –