From c406053d9c663d51600e531a42a53b97cd1374ad Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Fri, 6 Sep 2024 20:59:51 -0400
Subject: [PATCH 1/2] Sync
---
files/vite.config.mjs | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/files/vite.config.mjs b/files/vite.config.mjs
index c2eff23..094da0e 100644
--- a/files/vite.config.mjs
+++ b/files/vite.config.mjs
@@ -12,24 +12,20 @@ import {
import { resolve } from 'path';
import { babel } from '@rollup/plugin-babel';
-const root = 'tmp/rewritten-app';
-const extensions = [
- '.mjs',
- '.gjs',
- '.js',
- '.mts',
- '.gts',
- '.ts',
- '.hbs',
- '.json',
-];
-
export default defineConfig(({ mode }) => {
return {
- root,
cacheDir: resolve('node_modules', '.vite'),
resolve: {
- extensions,
+ extensions: [
+ '.mjs',
+ '.gjs',
+ '.js',
+ '.mts',
+ '.gts',
+ '.ts',
+ '.hbs',
+ '.json',
+ ],
},
plugins: [
hbs(),
@@ -42,24 +38,25 @@ export default defineConfig(({ mode }) => {
babel({
babelHelpers: 'runtime',
- extensions,
+
+ // this needs .hbs because our hbs() plugin above converts them to
+ // javascript but the javascript still also needs babel, but we don't want
+ // to rename them because vite isn't great about knowing how to hot-reload
+ // them if we resolve them to made-up names.
+ extensions: ['.gjs', '.js', '.hbs', '.ts', '.gts'],
}),
],
optimizeDeps: optimizeDeps(),
- publicDir: resolve(process.cwd(), 'public'),
server: {
port: 4200,
- watch: {
- ignored: ['!**/tmp/rewritten-app/**'],
- },
},
build: {
- outDir: resolve(process.cwd(), 'dist'),
+ outDir: 'dist',
rollupOptions: {
input: {
- main: resolve(root, 'index.html'),
+ main: 'index.html',
...(shouldBuildTests(mode)
- ? { tests: resolve(root, 'tests/index.html') }
+ ? { tests: 'tests/index.html' }
: undefined),
},
},
From 913634d8a05829d9b4585f2d1e9d5cc2aab30065 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Fri, 6 Sep 2024 21:13:51 -0400
Subject: [PATCH 2/2] tests/index.html
---
files-override/tests/index.html | 1 -
1 file changed, 1 deletion(-)
diff --git a/files-override/tests/index.html b/files-override/tests/index.html
index 860a56c..f28b7c5 100644
--- a/files-override/tests/index.html
+++ b/files-override/tests/index.html
@@ -27,7 +27,6 @@
-