mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
feat: move all frontend projects under the same Angular workspace (#1141)
* feat: move all frontend projects under the same Angular workspace * Refactor/angular workspace (#1154) * update frontend build steps Co-authored-by: waterplea <alexander@inkin.ru> Co-authored-by: Matt Hill <matthewonthemoon@gmail.com> Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com>
This commit is contained in:
15
frontend/projects/ui/postprocess.ts
Normal file
15
frontend/projects/ui/postprocess.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { parse } from 'node-html-parser'
|
||||
import * as fs from 'fs'
|
||||
|
||||
let index = fs.readFileSync('./dist/ui/index.html').toString('utf-8')
|
||||
|
||||
const root = parse(index)
|
||||
for (let elem of root.querySelectorAll('link')) {
|
||||
if (elem.getAttribute('rel') === 'stylesheet') {
|
||||
const sheet = fs
|
||||
.readFileSync('./dist/ui/' + elem.getAttribute('href'))
|
||||
.toString('utf-8')
|
||||
index = index.replace(elem.toString(), '<style>' + sheet + '</style>')
|
||||
}
|
||||
}
|
||||
fs.writeFileSync('./dist/ui/index.html', index)
|
||||
Reference in New Issue
Block a user