| 1234567891011121314151617181920212223242526272829303132333435363738394041 | from pathlib import Pathfrom json import loadsfrom shutil import rmtreefrom shutil import copytreefrom source.cx_maketool import sass_compilerfrom source.cx_maketool import esbuild_compilerfrom source.cx_maketool import renderfrom source.cx_maketool import scriptfrom source.cx_maketool import linkroot = Path(__file__).absolute()source = root / Path("source/")build = root / Path("build/")views = source / Path("views/")styles = source / Path("theme/")scripts = source / Path("scripts/")assets = source / Path("assets/")bundles = build / Path("bundle/")assets_output = build / Path("assets/")index = views / Path("core.html")scripts_loader = scripts / Path("code.js")theme_loader = styles / Path("core.sass")index_output = build / Path("index.html")script_bundle = bundle / Path("app.js")theme_bundle = bundle / Path("theme.css")if build.exists():    rmtree(build)build.mkdir()bundles.mkdir()sass_compiler(theme_loader).build(theme_bundle)esbuild_compiler(scripts_loader).build(script_bundle)copytree(assets, assets_output)copytree(config, config_output)
 |