Angular 1.x と Angular 7 の両方のルートを持つハイブリッド環境があります。Angular 1.x ルートは古いブートストラップ 3 を使用していますが、Angular 7 はブートストラップ 4 を使用する必要があります。インポートすることで、Angular 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: cannot read property 'replace' of undefined at normalizeBackSlashDirection (C:\Users...\RequestShortener.js) :16:17) コンパイラで新しいコンパイラ (C:\Users\r...\Compiler.js:185:27) で新しい RequestShortener (C:\Users...\RequestShortener.js:26:15) で。 Object.pitch (C:\Users.. .\mini-css-extract-plugin\dist\loader.js:70:43) 機能する唯一のオプションは、コンポーネントの先頭に以下を追加して、css をモジュールに直接インポートすることでした。
import '../../../node_modules/bootstrap/dist/css/bootstrap.css';
しかし、ブートストラップ 4 はブートストラップ 3 クラスをオーバーライドし、Angular 1.x のスタイリングを壊します。
ヘルプpppp