summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/serve-esbuild.mjs
blob: 68dff2c2d01fe1c4352d91a7a525f36a5ca0889c (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
#!/usr/bin/env node
/* eslint-disable no-undef */

import linaria from '@linaria/esbuild'
import esbuild from 'esbuild'
import { buildConfig } from "./build-fast-with-linaria.mjs"
import fs from 'fs';

fs.writeFileSync("dev-html/manifest.json", fs.readFileSync("manifest-v2.json"))
fs.writeFileSync("dev-html/mocha.css", fs.readFileSync("node_modules/mocha/mocha.css"))
fs.writeFileSync("dev-html/mocha.js", fs.readFileSync("node_modules/mocha/mocha.js"))
fs.writeFileSync("dev-html/mocha.js.map", fs.readFileSync("node_modules/mocha/mocha.js.map"))

const server = await esbuild
  .serve({
    servedir: 'dev-html',
  }, { ...buildConfig, outdir: 'dev-html/dist' })
  .catch((e) => {
    console.log(e)
    process.exit(1)
  });

console.log("ready!", server.port);