| | |
| | | import chokidar from "chokidar" |
| | | import prettyBytes from "pretty-bytes" |
| | | import { execSync, spawnSync } from "child_process" |
| | | import { transform as cssTransform } from "lightningcss" |
| | | import http from "http" |
| | | import serveHandler from "serve-handler" |
| | | import { WebSocketServer } from "ws" |
| | |
| | | default: false, |
| | | describe: "show detailed bundle information", |
| | | }, |
| | | concurrency: { |
| | | number: true, |
| | | describe: "how many threads to use to parse notes", |
| | | }, |
| | | } |
| | | |
| | | function escapePath(fp) { |
| | |
| | | } |
| | | |
| | | function gitPull(origin, branch) { |
| | | const flags = ["-s", "recursive", "-X", "ours", "--no-edit"] |
| | | const flags = ["--no-rebase", "--autostash", "-s", "recursive", "-X", "ours", "--no-edit"] |
| | | spawnSync("git", ["pull", ...flags, origin, branch], { stdio: "inherit" }) |
| | | } |
| | | |
| | |
| | | sassPlugin({ |
| | | type: "css-text", |
| | | cssImports: true, |
| | | async transform(css) { |
| | | const { code } = cssTransform({ |
| | | filename: "style.css", |
| | | code: Buffer.from(css), |
| | | minify: true, |
| | | }) |
| | | return code.toString() |
| | | }, |
| | | }), |
| | | { |
| | | name: "inline-script-loader", |