forked from MapComplete/MapComplete
Tooling: add HTTPS-mode development hosting for debugging on Android
This commit is contained in:
parent
53524532ef
commit
e71ae91e2c
3 changed files with 33 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
|||
import { defineConfig } from "vite"
|
||||
import { svelte } from "@sveltejs/vite-plugin-svelte"
|
||||
import fs from "fs"
|
||||
import basicSsl from '@vitejs/plugin-basic-ssl'
|
||||
|
||||
const allHtmlFiles = fs.readdirSync(".").filter((f) => f.endsWith(".html"))
|
||||
const input = {}
|
||||
|
@ -10,7 +11,12 @@ for (const html of allHtmlFiles) {
|
|||
const name = html.substring(0, html.length - 5)
|
||||
input[name] = "./" + html
|
||||
}
|
||||
|
||||
console.log("Args:",process.argv)
|
||||
const plugins = [svelte() ]
|
||||
if(process.argv.indexOf("--https") >= 0){
|
||||
console.log("Adding basicSSL")
|
||||
plugins.push(basicSsl())
|
||||
}
|
||||
export default defineConfig({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
|
@ -18,7 +24,7 @@ export default defineConfig({
|
|||
},
|
||||
},
|
||||
base: `${ASSET_URL}`,
|
||||
plugins: [svelte()],
|
||||
plugins ,
|
||||
server: {
|
||||
port: 1234,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue