electron-userland / electron-userland/electron-webpack

Access to Electron's require

Open
#201 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

Hello,

I'm trying to call `require` on an absolute path from the main process.
Something like this:
```js
require('/Users/john/Library/Application Support/app/app-plugin-foobar')
```

But, as webpack is parsing the require, I get an error as webpack is not allowing absolute paths:

```
Error: Cannot find module '/Users/john/Library/Application Support/app/app-plugin-foobar'
at webpackEmptyContext ...
```

I'm not sure if I'm supposed to use `IgnorePlugin`, `externals` or `ContextReplacementPlugin`. Couldn't we have a `require.native('path')` that would bypass webpack ?

Thanks

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.