Migration to VIte 4 (working)
This commit is contained in:
parent
17d80aa9ca
commit
8072a944a9
@ -61,24 +61,23 @@
|
|||||||
|
|
||||||
<!-- Inject Some Variables and generate the manifest json -->
|
<!-- Inject Some Variables and generate the manifest json -->
|
||||||
<script>
|
<script>
|
||||||
<!-- We can load JSON directly -->
|
<!-- Json is actually a JS object, assign it directly -->
|
||||||
window.FileBrowser = [{[ .Json ]}];
|
window.FileBrowser = [{[ .Json ]}];
|
||||||
window.__appendStaticUrl = (filename) => {
|
<!-- Global function to prepend static url -->
|
||||||
return `$(window.FileBrowser.StaticURL)/$(filename)`;
|
window.__prependStaticUrl = (url) => {
|
||||||
}
|
return `${window.FileBrowser.StaticURL}/${url.replace(/^\/+/, '')}`;
|
||||||
|
};
|
||||||
var fullStaticURL = window.location.origin + window.FileBrowser.StaticURL;
|
|
||||||
var dynamicManifest = {
|
var dynamicManifest = {
|
||||||
name: window.FileBrowser.Name || "File Browser",
|
name: window.FileBrowser.Name || "File Browser",
|
||||||
short_name: window.FileBrowser.Name || "File Browser",
|
short_name: window.FileBrowser.Name || "File Browser",
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
src: fullStaticURL + "/img/icons/android-chrome-192x192.png",
|
src: window.__prependStaticUrl("/img/icons/android-chrome-192x192.png"),
|
||||||
sizes: "192x192",
|
sizes: "192x192",
|
||||||
type: "image/png",
|
type: "image/png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: fullStaticURL + "/img/icons/android-chrome-512x512.png",
|
src: window.__prependStaticUrl("/img/icons/android-chrome-512x512.png"),
|
||||||
sizes: "512x512",
|
sizes: "512x512",
|
||||||
type: "image/png",
|
type: "image/png",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"serve": "vite serve",
|
"serve": "vite serve",
|
||||||
"build": "rimraf dist && vite build",
|
"build": "vite build",
|
||||||
"watch": "rimraf dist && vite build --watch",
|
"watch": "vite build --watch",
|
||||||
"lint": "eslint --ext .vue,.js src/",
|
"lint": "eslint --ext .vue,.js src/",
|
||||||
"lint:fix": "eslint --ext .vue,.js src/ --fix",
|
"lint:fix": "eslint --ext .vue,.js src/ --fix",
|
||||||
"format": "prettier --write ."
|
"format": "prettier --write ."
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
@import "material-icons/iconfont/filled.css";
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Roboto";
|
font-family: "Roboto";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
@ -235,8 +237,6 @@
|
|||||||
U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@import "~material-icons/iconfont/filled.css";
|
|
||||||
|
|
||||||
.material-icons {
|
.material-icons {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
vue: "vue/dist/vue.esm.js",
|
||||||
"@/": fileURLToPath(new URL("./src/", import.meta.url)),
|
"@/": fileURLToPath(new URL("./src/", import.meta.url)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -24,16 +25,9 @@ export default defineConfig({
|
|||||||
experimental: {
|
experimental: {
|
||||||
renderBuiltUrl(filename, { hostType }) {
|
renderBuiltUrl(filename, { hostType }) {
|
||||||
if (hostType === "js") {
|
if (hostType === "js") {
|
||||||
return { runtime: `window.__appendStaticUrl("${filename}")` };
|
return { runtime: `window.__prependStaticUrl("${filename}")` };
|
||||||
// } else if (hostType === "css") {
|
|
||||||
// return `'[{[ .StaticURL ]}]/${filename}'`;
|
|
||||||
} else if (hostType === "html") {
|
} else if (hostType === "html") {
|
||||||
return `[{[ .StaticURL ]}]/${filename}`;
|
return `[{[ .StaticURL ]}]/${filename}`;
|
||||||
// return {
|
|
||||||
// runtime: `window.__appendStaticUrl(${JSON.stringify(filename)})`,
|
|
||||||
// };
|
|
||||||
// if (hostType === "js") {
|
|
||||||
// return { runtime: `window.__toCdnUrl(${JSON.stringify(filename)})` };
|
|
||||||
} else {
|
} else {
|
||||||
return { relative: true };
|
return { relative: true };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user