我是Angular 2的新用户,有一些问题.
传统上,我们可以使用<link rel="stylesheet" href="node_modules/normalize.css/normalize.css" />
来导入css文件,但我想使用Angular 2来自动导入import
.
当我使用material 2时,我try 使用同样的方法:
// angular-cli-build.js
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'normalize-path/index.js',
]
});
};
// system-config.ts
const map: any = {
'normalize': 'vendor/normalize-path',
};
/** User packages configuration. */
const packages: any = {
'normalize': {main: 'index.js'},
};
// app.component.ts
import { normalize } from 'normalize-path';
编辑会抱怨:
找不到模块"规范化路径".
而且代码无法编译.但我真的不知道出了什么问题.