我有一个具有角1.x和角7路由的混合环境。角1.x路由使用旧的引导3,而角7应该使用引导4。
@import "../../../node_modules/bootstrap/scss/bootstrap.scss";
在组件内部
styles: [`
@import '../../../node_modules/bootstrap/dist/css/bootstrap.css';
`]
但我一直
模块构建错误失败(来自./node_modules/mini-css-extract-plugin/dist/loader.js):TypeError:无法读取未定义at normalizeBackSlashDirection (C:\Users...\RequestShortener.js:16:17) at new RequestShortener (C:\Users...\RequestShortener.js:26:15) at new Compiler (C:\Users\r...\Compiler.js:185:27) at Compiler.createChildCompiler (C:\ )的属性“替换”在(C:\Users...\mini-css-extract-plugin\dist\loader.js:70:43) Users...\Compiler.js:508:25的Compilation.createChildCompiler (C:\Users...\Compilation.js:2494:24)上,唯一可行的选择是通过在组件顶部添加以下内容直接将css导入到模块:
import '../../../node_modules/bootstrap/dist/css/bootstrap.css';
但是,引导4覆盖了引导3类,破坏了我的角度1.x样式。
赫普普
发布于 2019-03-13 02:02:27
我认为您可以在组件中使用styleUrls: [],
。
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss', '../../node_modules/bootstrap/dist/css/bootstrap.css'],
})
发布于 2019-03-13 02:04:03
海事组织,你不能同时拥有3和4而没有冲突。
我有一个混合环境,有角1.x和角7路线
你为什么一开始就需要这个?
https://stackoverflow.com/questions/55138932
复制