no async
This commit is contained in:
@@ -7,12 +7,12 @@ const esbuild_1 = require("esbuild");
|
||||
const fs_1 = require("fs");
|
||||
const paths_1 = require("./paths");
|
||||
const readmeta_1 = __importDefault(require("./readmeta"));
|
||||
async function default_1(name, watchCallback = false) {
|
||||
function default_1(name, watchCallback = false) {
|
||||
//read meta file
|
||||
let [metaJson, metaString] = (0, readmeta_1.default)(name);
|
||||
let path = (0, paths_1.ScriptPath)(name);
|
||||
let pathDist = (0, paths_1.DistPath)(name);
|
||||
let result = await runEsbuild({
|
||||
let result = runEsbuild({
|
||||
entryPoints: [(0, paths_1.ScriptPath)(name).main],
|
||||
outfile: pathDist,
|
||||
target: 'esnext',
|
||||
@@ -71,7 +71,7 @@ function doErrorFile(pathError, pathOutFile, error) {
|
||||
(0, fs_1.unlinkSync)(pathError);
|
||||
}
|
||||
}
|
||||
async function runEsbuild(opts, watchCallback, toWatch = false) {
|
||||
function runEsbuild(opts, watchCallback, toWatch = false) {
|
||||
opts.write = false;
|
||||
if (toWatch) {
|
||||
opts.watch = {
|
||||
@@ -109,7 +109,7 @@ async function runEsbuild(opts, watchCallback, toWatch = false) {
|
||||
};
|
||||
}
|
||||
try {
|
||||
let res = await (0, esbuild_1.build)(opts);
|
||||
let res = (0, esbuild_1.buildSync)(opts);
|
||||
let content = '';
|
||||
if (res.outputFiles && res.outputFiles.length > 0) {
|
||||
content = res.outputFiles[0].text;
|
||||
|
||||
Reference in New Issue
Block a user