Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-06-01 11:30:11 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-06-01 11:30:11 -0700
commitbf24eda9cb1210e216a73848d1618ea6343f36e0 (patch)
tree80abd30555001fc0aaf7a51f974027383dd75c93
parent10b27a788d66d226b334c13e5892ce1c9b7b8ffa (diff)
Don't build scenarios server-side
-rw-r--r--esbuild-server.mjs7
1 files changed, 5 insertions, 2 deletions
diff --git a/esbuild-server.mjs b/esbuild-server.mjs
index 323a97e..0f169f3 100644
--- a/esbuild-server.mjs
+++ b/esbuild-server.mjs
@@ -156,6 +156,9 @@ const resolveSvgImports = {
setup(build) {
build.onStart(() => {
console.log("BUILD STARTED");
+ console.log(build.initialOptions.outdir);
+
+ fs.rmSync(path.resolve(build.initialOptions.outdir), { recursive: true, force: true });
});
build.onResolve({ filter: /\.svg$/ }, args => {
@@ -199,7 +202,7 @@ const externalSvgToInternal = {
});
const refsQuery = [...refs[filename]].join(', ');
- external.querySelectorAll(refsQuery).forEach(node => defs.appendChild(node));
+ external.querySelectorAll(refsQuery).forEach(node => defs.append(node));
});
});
@@ -218,7 +221,7 @@ const ctx = await esbuild.context({
outdir: 'build',
plugins: [
resolveSvgImports,
- externalSvgToInternal,
+ // externalSvgToInternal,
// buildStatusPlugin
],
loader: {