2022-03-29 17:32:37 +02:00
|
|
|
#!/usr/bin/env node
|
2022-04-05 17:16:09 +02:00
|
|
|
/* eslint-disable no-undef */
|
2022-03-25 20:57:27 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
|