aboutsummaryrefslogtreecommitdiff
path: root/src/build.gleam
blob: a35e8aa41289cfc74c244c76048d5a2f19334c5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// import gleam/string
import gleam/javascript/promise.{type Promise}
// import bundle

// const entry = "./build/dev/javascript/wechat_dev_tools/bundle.mjs"
// const app_content = "import { app } from './bundle.mjs'; app()"
// const dist = "./dist/"
// const src = "./src/"
//
// fn page_content(p: String) -> String {
//  "improt { pages, page } from './bundle.mjs'; page(pages(), \"" <> p <> "\")"
// } 

@external(javascript, "./build_ffi.mjs", "bundle_build")
pub fn bundle_build(entry f: String, outfile o: String) -> Promise(Result(Nil, String))

@external(javascript, "./build_ffi.mjs", "js_build")
pub fn js_build(content c: String, outfile o: String) -> Promise(Result(Nil, String))

@external(javascript, "./build_ffi.mjs", "json_build")
pub fn json_build(json f: String, outfile o: String) -> Promise(Result(Nil, String))

@external(javascript, "./build_ffi.mjs", "wxml_build")
pub fn wxml_build(wxml f: String, outfile o: String) -> Promise(Result(Nil, String))

@external(javascript, "./build_ffi.mjs", "less_build")
pub fn less_build(less f: String, outfile o: String) -> Promise(Result(Nil, String))

pub fn main() {
  Nil
}