base option not support fully url at dev mode
See original GitHub issueDescribe the bug
from #833, the last comment.
In my case, use base like this:
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
export default defineConfig({
plugins: [
vue({
template: {
compilerOptions: {
isCustomElement: function(tag) {
return tag.includes("fl-") || tag.includes("sl-");
}
}
}
})
],
base: "http://localhost:3003/",
root: "/Users/zhouyiming/Project/frameless-pc/src/pages/demo1"
});
But when i visit the http://localhost:3003/, the assets is not be rewrited
if this page is nested in a “main” page, this request will be 404
Reproduction
https://stackblitz.com/edit/vitejs-vite-ofxh2y?file=vite.config.js&terminal=dev
System Info
System:
OS: macOS 12.3.1
CPU: (8) arm64 Apple M1
Memory: 97.41 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 18.0.0 - /opt/homebrew/bin/node
npm: 8.6.0 - /opt/homebrew/bin/npm
Browsers:
Chrome: 102.0.5005.115
Safari: 15.4
npmPackages:
vite: ^2.9.9 => 2.9.9
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Configure on-device developer options - Android Developers
The Settings app on Android includes a screen called Developer options that ... Note: The adb demo mode commands might not work on...
Read more >The Document Base URL element - HTML - MDN Web Docs
The HTML element specifies the base URL to use for all relative URLs in a document. There can be only one element in...
Read more >Development Mode and Production Mode | Looker
Open the left navigation panel and select the Development Mode toggle. Select Exit Development Mode in the banner at the top of the...
Read more >Show full URI/URL in Chrome's developer tools Network tab
When using Chrome to debug, I find it incredibly difficult to be efficient due to the fact that I don't see how I...
Read more >Developer Mode - Duda Support
Click the Developer Mode button in navigation bar. Alternatively, right-click on a widget and select Edit HTML/CSS, and then click Dev Mode in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One of the reasons that #8450 adds the options at
build
is to allow to do the same in the future fordev.advancedDevOptions
. But the path there may be a bit long, and it is unclear to me at this point if the flexibility justifies the complexity at dev time. @Yiniau did you check https://vitejs.dev/config/#server-origin, this is what some backend integrations are using right nowactually, there are two servers is running,
main
server run in port 10000page
server run in port 3000that look like Single-SPA, if developer visit 3000, all be fine. but some assets will be 404 when they visit 10000.
if the url not change, any other config just helpless.