Fix paths with a "." in them not loading

This commit is contained in:
Alexis Sellier
2021-06-20 17:29:55 +02:00
parent e9697f36b6
commit 8d2e05f9a8
3 changed files with 47 additions and 5 deletions
+41 -1
View File
@@ -25,7 +25,8 @@
"eslint-plugin-svelte3": "^3.2.0",
"svelte-check": "^1.5.2",
"typescript": "^4.2.4",
"vite": "^2.3.7"
"vite": "^2.3.7",
"vite-plugin-rewrite-all": "^0.1.2"
}
},
"node_modules/@babel/code-frame": {
@@ -1369,6 +1370,15 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"node_modules/connect-history-api-fallback": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz",
"integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==",
"dev": true,
"engines": {
"node": ">=0.8"
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -3096,6 +3106,21 @@
"fsevents": "~2.3.1"
}
},
"node_modules/vite-plugin-rewrite-all": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/vite-plugin-rewrite-all/-/vite-plugin-rewrite-all-0.1.2.tgz",
"integrity": "sha512-hBFuG043kbixgZ/ke9SzKhkO6P8a5ryxD0CmZTe+/Cz17RIKi7uSeNUJy79V4FgavZ7pWVRg0tqVwJ7lP/A2/Q==",
"dev": true,
"dependencies": {
"connect-history-api-fallback": "^1.6.0"
},
"engines": {
"node": ">=12.0.0"
},
"peerDependencies": {
"vite": "^2.0.2"
}
},
"node_modules/vite/node_modules/esbuild": {
"version": "0.12.9",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.9.tgz",
@@ -4023,6 +4048,12 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"connect-history-api-fallback": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz",
"integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==",
"dev": true
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -5289,6 +5320,15 @@
}
}
},
"vite-plugin-rewrite-all": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/vite-plugin-rewrite-all/-/vite-plugin-rewrite-all-0.1.2.tgz",
"integrity": "sha512-hBFuG043kbixgZ/ke9SzKhkO6P8a5ryxD0CmZTe+/Cz17RIKi7uSeNUJy79V4FgavZ7pWVRg0tqVwJ7lP/A2/Q==",
"dev": true,
"requires": {
"connect-history-api-fallback": "^1.6.0"
}
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+4 -3
View File
@@ -17,7 +17,8 @@
"eslint-plugin-svelte3": "^3.2.0",
"svelte-check": "^1.5.2",
"typescript": "^4.2.4",
"vite": "^2.3.7"
"vite": "^2.3.7",
"vite-plugin-rewrite-all": "^0.1.2"
},
"dependencies": {
"@types/marked": "^2.0.3",
@@ -27,7 +28,7 @@
"multibase": "^4.0.4",
"multihashes": "^4.0.2",
"svelte": "^3.32.3",
"svelte-routing": "^1.6.0",
"svelte-preprocess": "^4.7.2"
"svelte-preprocess": "^4.7.2",
"svelte-routing": "^1.6.0"
}
}
+2 -1
View File
@@ -1,12 +1,13 @@
import path from "path";
import { UserConfig } from "vite";
import svelte from "@sveltejs/vite-plugin-svelte";
import rewriteAll from "vite-plugin-rewrite-all";
const config: UserConfig = {
optimizeDeps:{
exclude:['svelte-routing']
},
plugins: [svelte()],
plugins: [svelte(), rewriteAll()],
resolve: {
alias: {
"@app": path.resolve("./src"),