electron-userland / electron-userland/electron-webpack

Disable minification (which is breaking code sometimes)

Open
#362 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

* **Version**: electron-webpack 2.8.2
* **Target**: MacOS 10.15.4

I am trying to inject a preload script with a **require** exposition so I can use Spectron with it as recommended [here](https://github.com/electron-userland/spectron#node-integration)
```
if (process.env.NODE_ENV === 'test') {
window.electronRequire = require
}
```
But when running electron-webpack, minification change the function name and the **require** exposition does not work anymore.
```
...
"test" === process.env.NODE_ENV
? ((window.electronRequire = t(6))
...
```
Could you please give us a way to disable minification ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.