I have two modules: FrontUI & AdminUI. The FrontUI is the root module and the AdminUI is lazy loaded.
In the Admin section, I need to load few .css files that are different from the FrontUI and is particular to admin section only. I tried the following -
- I have added these .css file path in angular.json as shown below and this works. But this will bundle these files during startup, which is not proper
"styles": [
"node_modules/@xyzPlugIn/base.css",
"node_modules/@xyzPlugIn/theme.css"
],
- I have added the .css file path in component.ts file as follows, but this is not rendering the css
@Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['../node_modules/@xyzPlugIn/base.css',
'../node_modules/@xyzPlugIn/theme.css']
})
Can different styles be loaded for two separate modules, as the client/users are different? In production environment, can these files be bundled?
P.S: The project structure I have mentioned is short for better understanding.
import '@xyzPlugIn/base.css';. If you use scss, add@import "~@xyzPlugIn/base";to your stylesheet. Also, are your sure your relative path to node_modules is right ?