You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
785 B
JavaScript
40 lines
785 B
JavaScript
import { Builder } from "/loader/builder.js"
|
|
|
|
export class EditorBuild {
|
|
deps = [
|
|
'forms/button-group.js',
|
|
'dialog/dialog.js',
|
|
'menu/dropdown.js',
|
|
'editor/header.js',
|
|
'editor/file-group.js',
|
|
'editor/file-view.js',
|
|
'editor/text-edit.js',
|
|
'editor/code-edit.js',
|
|
'loader/builder.js',
|
|
'editor/app.js',
|
|
]
|
|
|
|
constructor() {
|
|
this.files = undefined
|
|
}
|
|
|
|
async loadFiles() {
|
|
const files = []
|
|
for (const name of this.deps) {
|
|
const resp = await fetch(name)
|
|
files.push({
|
|
name,
|
|
data: await resp.text(),
|
|
})
|
|
}
|
|
this.files = files
|
|
}
|
|
|
|
async build() {
|
|
if (this.files === undefined) {
|
|
await this.loadFiles()
|
|
}
|
|
const builder = new Builder(this.files)
|
|
return builder.build()
|
|
}
|
|
} |