diff --git a/apps/ms-word-addin/vite.config.ts b/apps/ms-word-addin/vite.config.ts index 24b6cc87..01ede165 100644 --- a/apps/ms-word-addin/vite.config.ts +++ b/apps/ms-word-addin/vite.config.ts @@ -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: [ { @@ -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({ @@ -71,6 +73,6 @@ export default defineConfig({ }, server: { port: DEV_SERVER_PORT, - https: IS_PRODUCTION ? undefined : httpsConfigDevMode + https: IS_PRODUCTION ? undefined : httpsConfigDevMode() } })