-
Notifications
You must be signed in to change notification settings - Fork 52
Different cache folder for different envs #76
Comments
Additional notes on [email protected] being deprecated: it only became clear to me after spending a day investigating, but: the acorn-based istanbul is pretty dead. The new istanbul is heavily marketed as The new instrumenter is based on babel, which makes a bunch of sense:
Quick size comparison: Legacy istanbul
babel-plugin-istanbul
N.B: size of the instrument+coverage+babel plug-in only:
TL;DR istanbul is now babel-based, it kinda blows if you're not already using babel, but I don't think electron-compile{,rs} should keep using [email protected] |
See electron-userland#76 - Drop [email protected] dependency, add babel-plugin-istanbul - Add getEnv() helper to SimpleCompilerBase - Support an environment string in the `coverage` option for both typescript and babel compilers - Make babel compiler use compilerContext as compile options - Drop sorcery dependency, pass inputSourceMap to babel instead - Always use babel+babel-plugin-istanbul to instrument code for measuring coverage - In ts+babel, translate ts sourcemap options to babel. With a twist, for inline sourcemaps.
All done in:
Works great for me (typescript+babel, inline source maps): |
Closing in favor of both PRs. |
This issue applies both to electron-compile and electron-compilers, sorry
Reading through a bunch of code right now to find out if a different
$TEMP/compileCache_${hash}
will get generated ifNODE_ENV
changes, and.. it doesn't like it does?Here's the default cache directory code:
The problem is:
You can probably reproduce the problem easily if you use electron-compile with a
.babelrc
like:run it once with
NODE_ENV=production
, then again withNODE_ENV=development
, I'm 80% confident you'd end up not seeing sourceMaps still.Here's my proposal for electron-compile:
calculateDefaultCompileCacheDirectory
to feed off ofdigest-for-object
)Tangentially, here's what I've got planned for electron-compilers:
coverage
options (typescript & babel) only apply whenNODE_ENV=test
coverage
is a string, andcoverage: true
would always instrument, so that the old behavior is retained?coverage
option use babel-plugin-istanbul (a relatively thin wrapper over new-istanbul's instrumenting lib).__coverage__
variable)__coverage__
variable, with proper sourceMap support (it's like 8 lines).Let me know if any of that sounds bad @paulcbetts & others so I can adjust plans accordingly!
The text was updated successfully, but these errors were encountered: