diff --git a/doric-cli/src/actions.ts b/doric-cli/src/actions.ts index 9df3ac12..16d59d1d 100644 --- a/doric-cli/src/actions.ts +++ b/doric-cli/src/actions.ts @@ -1,8 +1,8 @@ import { Shell } from "./shell"; import { createMergedSourceMapFromFiles } from "source-map-merger" -import fs from "fs" +import fs from "fs"; import { glob } from "./util"; - +import path from "path"; export async function build() { await Shell.exec("node", ["node_modules/.bin/tsc", "-p", "."]); await Shell.exec("node", ["node_modules/.bin/rollup", "-c"]); @@ -10,6 +10,19 @@ export async function build() { for (let bundleFile of bundleFiles) { await doMerge(bundleFile); } + if (fs.existsSync("assets")) { + const assets = await fs.promises.readdir("assets") + for (let asset of assets) { + const assetFile = path.resolve("assets", asset); + const stat = await fs.promises.stat(assetFile); + await Shell.exec("cp", ["-rf", assetFile, "bundle"]); + if (stat.isDirectory()) { + console.log(`Asset -> ${asset.yellow}`); + } else { + console.log(`Asset -> ${asset.green}`); + } + } + } } export async function clean() { diff --git a/doric-demo/assets/fonts/assets_iconfont.ttf b/doric-demo/assets/fonts/assets_iconfont.ttf new file mode 100644 index 00000000..6ea00a93 Binary files /dev/null and b/doric-demo/assets/fonts/assets_iconfont.ttf differ diff --git a/doric-demo/assets/iconfont.ttf b/doric-demo/assets/iconfont.ttf new file mode 100644 index 00000000..6ea00a93 Binary files /dev/null and b/doric-demo/assets/iconfont.ttf differ