Skip to content

Commit

Permalink
chore(ms-word-addin): fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
panzerdp committed Feb 10, 2023
1 parent 2941415 commit fd41aec
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/ms-word-addin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const DEV_SERVER_PORT = 3000
const HOME_DIRECTORY = os.homedir()
const IS_PRODUCTION = env.NODE_ENV === 'production'

console.log(IS_PRODUCTION)

const copyManifest = viteStaticCopy({
targets: [
{
Expand All @@ -34,11 +36,11 @@ const copyManifest = viteStaticCopy({
]
})

const httpsConfigDevMode = {
const httpsConfigDevMode = () => ({
key: fs.readFileSync(path.resolve(`${HOME_DIRECTORY}/.office-addin-dev-certs/localhost.key`)),
cert: fs.readFileSync(path.resolve(`${HOME_DIRECTORY}/.office-addin-dev-certs/localhost.crt`)),
ca: fs.readFileSync(path.resolve(`${HOME_DIRECTORY}/.office-addin-dev-certs/ca.crt`))
}
})

// https://vitejs.dev/config/
export default defineConfig({
Expand Down Expand Up @@ -71,6 +73,6 @@ export default defineConfig({
},
server: {
port: DEV_SERVER_PORT,
https: IS_PRODUCTION ? undefined : httpsConfigDevMode
https: IS_PRODUCTION ? undefined : httpsConfigDevMode()
}
})

0 comments on commit fd41aec

Please sign in to comment.