Roots Discourse

Manifest.json best-practice: same css in two different files

gulp
sage8

#1

What would be considered the correct way to add a script to two different files? I am currently overriding font-awesome which is automatically added to my front-end main.css file but I would like to include it in an additional admin.css file.

I tried:

…
"main.css": {
  "files": [
    "styles/main.scss"
  ],
  "main": true
},
"admin.css":{
  "bower": ["font-awesome"]
}
…

But this removes font-awesome from my front-end css file. I tried:

…
"main.css": {
  "files": [
    "styles/main.scss"
  ],
  "bower":["font-awesome"],
  "main": true
},
"admin.css":{
  "bower": ["font-awesome"]
}
…

with same results…


#2

Also tried:

....
"main.css": {
  "files": [
    "styles/main.scss"
  ],
  "main": true
},
"admin.css": {
  "files": [
    "../bower_components/font-awesome/css/font-awesome.min.css"
  ]
},
....

This worked but creates a copy of the font-awesome css file in my dev /assets/ folder.

Not sure if I’m ready to accept that behavior. Wondering if there is a better approach to this.