Repository navigation
Switch env var for isVSCE check - #8257
Conversation
|
Debugging this now, seems like this is causing extension activation to fail |
|
Should be working now - tested both through the VSCE development host and by manually packaging a VSIX and installing it |
yuchenshi
left a comment
There was a problem hiding this comment.
This seems fine but it's too confusing with a real env var.
Have we considered using a global variable instead, such as globalThis.WEBPACK_IS_VSCE? Or, can we at least add comments to the code saying it's not set but just defined by webpack?
I'll try out the global variable idea. |
|
Refactored as you suggested - it required a little bit of finagling to make work with our build/lint rules tho |
yuchenshi
left a comment
There was a problem hiding this comment.
General approach lgtm, see nits inline. Your call
| "latest" | ||
| ]; | ||
| const env = { ...process.env, VSCODE_CWD: "" }; | ||
| const env = { ...process.env, VSCODE_CWD: "", IS_FIREBASE_VSCE: "" }; |
| import { EMULATORS_SUPPORTED_BY_USE_EMULATOR, Emulators } from "../emulator/types"; | ||
| import { readTemplateSync } from "../templates"; | ||
|
|
||
| const INIT_TEMPLATE = readTemplateSync("hosting/init.js"); |
There was a problem hiding this comment.
Had to move this into the function so that it wasn't evaluated before activation.
There was a problem hiding this comment.
It's exactly this kind of stuff that makes me hate mutable state so much that I even awakened the mighty webpack. Well, at least we know what the tradeoffs are and we can deal with it another day
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8257 +/- ##
==========================================
- Coverage 51.02% 51.02% -0.01%
==========================================
Files 423 423
Lines 29944 29945 +1
Branches 6140 6140
==========================================
Hits 15278 15278
- Misses 13286 13287 +1
Partials 1380 1380 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
VSCODE_CWDis set whenever you're running within VSCode, so its not safe to assume we've been webpacked if it is set. Instead, we define our own variable and use that.Fixes #7471.