Skip to content

Commit

Permalink
fix(vxrn): fix double loading of vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
natew committed Sep 7, 2024
1 parent dbe3643 commit fc604d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/vxrn/src/exports/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const dev = async (optionsIn: VXRNOptions & { clean?: boolean }) => {
await ensureDir(cacheDir)

const serverConfig = await getViteServerConfig(options)

const viteServer = await createServer(serverConfig)

// this fakes vite into thinking its loading files, so it hmrs in native mode despite not us never requesting the url
Expand Down
3 changes: 1 addition & 2 deletions packages/vxrn/src/plugins/reactNativeHMRPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function reactNativeHMRPlugin({ root }: VXRNOptionsFilled) {
let resolver

return {
name: 'client-transform',
name: 'vxrn:native-hmr-transform',

// TODO see about moving to hotUpdate
// https://deploy-preview-16089--vite-docs-main.netlify.app/guide/api-vite-environment.html#the-hotupdate-hook
Expand Down Expand Up @@ -52,7 +52,6 @@ export function reactNativeHMRPlugin({ root }: VXRNOptionsFilled) {

// got a weird pre compiled file on startup
if (code.startsWith(`'use strict';`)) {
console.log('is this still happening?')
return
}

Expand Down
3 changes: 3 additions & 0 deletions packages/vxrn/src/utils/getBaseViteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export function getBaseViteConfig({ mode }: { mode: 'development' | 'production'
return {
mode,

// we load the config ourselves
configFile: false,

plugins: [
{
name: 'platform-specific-resolve',
Expand Down

0 comments on commit fc604d1

Please sign in to comment.