Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

addBypassChecker not working #313

Open
rivafarabi opened this issue Oct 18, 2018 · 0 comments
Open

addBypassChecker not working #313

rivafarabi opened this issue Oct 18, 2018 · 0 comments

Comments

@rivafarabi
Copy link

I have a problem where I can't load a javascript module outside the packaged electron app.

Here is my code

const requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require;
const extFolder = fs.readdirSync(extensionsDir);

extFolder.forEach(name => {
      extModules[name] = requireFunc(`${path.join(extensionsDir, name)}`);
      let packageJsonFile = path.join(extensionsDir, name, 'package.json');
      fs.readFile(packageJsonFile, 'utf8', function (err, data) {
        if (err) {
          log.error(err);
          return;
        } else {
          extDescriptions.push(JSON.parse(data));
        }
      });
      extCommands = extCommands.concat(extModules[name].selections);
});

It works fine in both development and production mode. But when I start to use electron-compile, it only works in dev mode.

I tried using addBypassChecker((filePath) => true); as mentioned in #199 but no luck.

Is there any way to solve this? Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant