aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKai WU <kaiwu2004@gmail.com>2024-07-19 11:04:11 +0800
committerKai WU <kaiwu2004@gmail.com>2024-07-19 11:04:11 +0800
commitd409d8893b099d484f3efbd8449a98018a28a13c (patch)
treec05cc91d914a643391132b73c6be041d68572911 /src
parent6069563e13a92ef59de8b69b9901acc42a3f86b6 (diff)
downloadwechat_dev_tools-d409d8893b099d484f3efbd8449a98018a28a13c.tar.gz
wechat_dev_tools-d409d8893b099d484f3efbd8449a98018a28a13c.zip
no need esbuild less plugin
Diffstat (limited to 'src')
-rw-r--r--src/build_ffi.mjs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/build_ffi.mjs b/src/build_ffi.mjs
new file mode 100644
index 0000000..d9d2671
--- /dev/null
+++ b/src/build_ffi.mjs
@@ -0,0 +1,26 @@
+import {build} from 'esbuild'
+
+export async function bundle_build(es, out, min) {
+ await build({
+ entryPoints: es,
+ bundle: true,
+ minify: min,
+ format: 'esm',
+ outdir: out,
+ allowOverwrite: true,
+ })
+}
+
+export async function js_build(js, out) {
+ await build({
+ stdin: {
+ contents: js,
+ loader: 'js',
+ }
+ bundle: false,
+ minify: false,
+ format: 'esm',
+ outfile: out,
+ allowOverwrite: true,
+ })
+}