From 4c904d88aba14d0d153bfac364630ad61832a73d Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 01 Jul 2023 20:35:27 +0000
Subject: [PATCH] rss + sitemap

---
 quartz/bootstrap-cli.mjs |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs
index e9cda4e..2824f8e 100755
--- a/quartz/bootstrap-cli.mjs
+++ b/quartz/bootstrap-cli.mjs
@@ -71,12 +71,18 @@
           setup(build) {
             build.onLoad({ filter: /\.inline\.(ts|js)$/ }, async (args) => {
               let text = await promises.readFile(args.path, 'utf8')
+              // remove default exports that we manually inserted
+              text = text.replace('export default', '')
+              text = text.replace('export', '')
+
+              const sourcefile = path.relative(path.resolve('.'), args.path)
+              const resolveDir = path.dirname(sourcefile)
               const transpiled = await esbuild.build({
                 stdin: {
                   contents: text,
                   loader: 'ts',
-                  resolveDir: '.',
-                  sourcefile: path.relative(path.resolve('.'), args.path),
+                  resolveDir,
+                  sourcefile,
                 },
                 write: false,
                 bundle: true,

--
Gitblit v1.10.0