forked from cms/tibi-svelte-starter
sourcemap tests
This commit is contained in:
7
scripts/cy-command.docker.sh
Executable file
7
scripts/cy-command.docker.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
|
||||
export DISPLAY=host.docker.internal:0.0
|
||||
echo DISPLAY: $DISPLAY
|
||||
yarn cy:$1
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
const esbuild = require("esbuild")
|
||||
const fs = require("fs")
|
||||
const path = require("path")
|
||||
|
||||
const config = require(process.cwd() +
|
||||
(process.argv?.length > 3 ? "/" + process.argv[3] : "/esbuild.config.js"))
|
||||
const { watch } = require("chokidar")
|
||||
@@ -20,10 +23,17 @@ async function build(catchError) {
|
||||
buildResults = buildResults
|
||||
? await buildResults.rebuild()
|
||||
: await esbuild.build(config.options)
|
||||
if (config.options.metafile) {
|
||||
fs.writeFileSync(
|
||||
path.dirname(config.options.outfile) + "/meta.json",
|
||||
JSON.stringify(buildResults.metafile, null, 4)
|
||||
)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
if (!catchError) throw e
|
||||
}
|
||||
|
||||
const timerEnd = Date.now()
|
||||
log(`built in ${timerEnd - timerStart}ms.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user