Skip to content

Commit acb117a

Browse files
committed
remove dotnet + ssl from vite.config
1 parent a94faa7 commit acb117a

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

vite.config.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,6 @@ import Markdown from 'unplugin-vue-markdown/vite'
1717
import svgLoader from 'vite-svg-loader'
1818
import configureMarkdown from './vite.markdown'
1919

20-
const baseFolder =
21-
env.APPDATA !== undefined && env.APPDATA !== ''
22-
? `${env.APPDATA}/ASP.NET/https`
23-
: `${env.HOME}/.aspnet/https`;
24-
25-
const certificateArg = process.argv.map(arg => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0]
26-
const certificateName = certificateArg ? certificateArg!.groups!.value : "myapp.client"
27-
28-
if (!certificateName) {
29-
console.error('Invalid certificate name. Run this script in the context of an npm/yarn script or pass --name=<<app>> explicitly.')
30-
process.exit(-1)
31-
}
32-
33-
const certFilePath = path.join(baseFolder, `${certificateName}.pem`)
34-
const keyFilePath = path.join(baseFolder, `${certificateName}.key`)
35-
36-
if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) {
37-
if (0 !== child_process.spawnSync('dotnet', [
38-
'dev-certs',
39-
'https',
40-
'--export-path',
41-
certFilePath,
42-
'--format',
43-
'Pem',
44-
'--no-password',
45-
], { stdio: 'inherit', }).status) {
46-
throw new Error("Could not create certificate.")
47-
}
48-
}
49-
5020
const currentDir = path.dirname(fileURLToPath(import.meta.url))
5121

5222
// https://vitejs.dev/config/
@@ -128,12 +98,5 @@ export default defineConfig({
12898
'@unhead/vue': path.join(currentDir, './node_modules/@unhead/vue'),
12999
'@servicestack/vue': path.join(currentDir, './node_modules/@servicestack/vue'),
130100
}
131-
},
132-
server: {
133-
port: 5173,
134-
https: {
135-
key: fs.readFileSync(keyFilePath),
136-
cert: fs.readFileSync(certFilePath),
137-
}
138101
}
139102
})

0 commit comments

Comments
 (0)