Closed stefan-bozic-quantox closed 1 year ago
The webpack command is controlled by the "dev-server" script in package.json. The debugging cli uses that script entry to start the dev server.
From what I see in the webpack documentation . . . adding those arguments to the webpack command sets env variable values and I don't see anything that suggests being able to specify an env file on the cli. You'd have to do some digging into webpack solutions for importing an env file and then adjust the dev-server command accordingly.
Hello, I'm working on an Excel add-in, and it's written in React. I followed Microsoft docs (https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-react). I have different .env files for different environments: .env.development, .env.qa, .env.staging, and .env.production. My question is: how can I dynamically pass the environment I want to use (so something like webpack --env environment=staging) to webpack.config.js? When I run npm start (office-addin-debugging start manifest.xml) everything that I try to pass to webpack.config.js is overwritten with { env: { WEBPACK_SERVE: true } }.