feat:add assets dealing
This commit is contained in:
parent
2580088804
commit
752f0dbafd
@ -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() {
|
||||
|
BIN
doric-demo/assets/fonts/assets_iconfont.ttf
Normal file
BIN
doric-demo/assets/fonts/assets_iconfont.ttf
Normal file
Binary file not shown.
BIN
doric-demo/assets/iconfont.ttf
Normal file
BIN
doric-demo/assets/iconfont.ttf
Normal file
Binary file not shown.
Reference in New Issue
Block a user