Brenton Simpson

Results 135 comments of Brenton Simpson

Thanks for the knowledge and quick fix! Should I need to do this? ```tsx const importWithoutVite = (path: string) => import(/* @vite-ignore */path); importWithoutVite('./config.js').then( ``` If I try to ```js...

After further investigation, since `build` puts the bundle in `assets`, but `serve` serves it from `/`, I end up with a path conflict. Is there a better strategy than handling...

Turns out you can skip the path switching for the devserver, because the devserver mounts at the root, and `/../` is the same as `/`. So `import('../my-asset.js')` will work whether...

Here's a prototype that seems to be working: ```tsx // Copyright 2023 Google LLC. // SPDX-License-Identifier: Apache-2.0 const literalDynamicImports = (literals: Array): PluginOption => { let inDevServer = false; return...

Dammit - just tried upgrading to [email protected] and this error is back: ``` Failed to load url /experiment-config.js (resolved id: /experiment-config.js). This file is in ../passthrough and will be copied...

I feel like I keep going down this route, I'm gonna spend more time that I can afford reverse engineering Vite's dev server to figure out precisely what I need...

@waynebloss - clever! You could inline `importer` into the HTML to skip a download. @connorgmeehan Did you try that in both `vite serve` and `vite build`? I feel like that's...

I just tested @connorgmeehan's workaround in the [reproduction](https://stackblitz.com/edit/vitejs-vite-fq1gc9?file=public%2Fsecret-number.js,main.js&terminal=dev), and adding a trailing `?` does seem to work around this.

Yeah. I wouldn't say it's "required," but it can be nice to ensure you're getting unique, uncached URLs on each load. I haven't played with it in this context to...

The workaround seems really fragile. I tried to implement it in the `literalDynamicImports` function above and was getting errors. I tried other techniques to make it dynamic like `.split('').join('')` and...