用于SASS字体导入的Webpack配置是一个带有SASS文件的文件?

时间:2016-12-12 08:42:59

标签: javascript angular sass webpack angular-cli

我需要制作一个包含里面字体文件的css包。没有外部文件。只有一个文件。

这是我的设置。我正在使用Angular2,由于某种原因,我的Component设置为ViewEncapsulation.Native。我要求styles内部的Component属性中的SASS文件(带字体导入)。我也在使用AngularCLI,因此我无法直接访问webpack.config,因此我在require方法中使用了内联选项。

我现在拥有的是:

@Component({
  selector: 'lms-root',
  templateUrl: './app.component.html',
  styles: [
    require('./../../node_modules/foundation-sites/dist/css/foundation.css'),
    require('!css!sass!url!./../assets/vendor/fontello/scss/_fontello.scss').toString(),
    require('./../assets/vendor/fontello/scss/_animation.scss'),
    require('./app.component.scss')
  ],
  encapsulation: ViewEncapsulation.Native
})
export class AppComponent {

0 个答案:

没有答案