From cef11a212ef15381a5c1707cca8efdc09733f6ed Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 18 Nov 2024 14:14:54 -0500 Subject: [PATCH] refactor: Place entry files within `src` directory Align with Gutenberg project practices. --- index.html => src/index.html | 2 +- remote.html => src/remote.html | 2 +- vite.config.js | 2 ++ vite.config.remote.js | 5 ++++- 4 files changed, 8 insertions(+), 3 deletions(-) rename index.html => src/index.html (83%) rename remote.html => src/remote.html (82%) diff --git a/index.html b/src/index.html similarity index 83% rename from index.html rename to src/index.html index 59f14388..32464ac4 100644 --- a/index.html +++ b/src/index.html @@ -10,6 +10,6 @@
- + diff --git a/remote.html b/src/remote.html similarity index 82% rename from remote.html rename to src/remote.html index 0884964f..bc4f072d 100644 --- a/remote.html +++ b/src/remote.html @@ -10,6 +10,6 @@
- + diff --git a/vite.config.js b/vite.config.js index f531d99e..ea19b206 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,7 +4,9 @@ import react from '@vitejs/plugin-react'; export default defineConfig({ base: '', build: { + outDir: '../dist', target: 'esnext', }, plugins: [react()], + root: 'src', }); diff --git a/vite.config.remote.js b/vite.config.remote.js index b956067d..1d177389 100644 --- a/vite.config.remote.js +++ b/vite.config.remote.js @@ -1,3 +1,4 @@ +import { resolve } from 'path'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { defaultRequestToExternal } from '@wordpress/dependency-extraction-webpack-plugin/lib/util'; @@ -6,13 +7,15 @@ import MagicString from 'magic-string'; export default defineConfig({ base: '', build: { + outDir: '../dist', rollupOptions: { - input: 'remote.html', + input: resolve(__dirname, 'src/remote.html'), external: externalize, }, target: 'esnext', }, plugins: [react(), wordPressExternals()], + root: 'src', }); function externalize(id) {