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

addBypassChecker not working #313

Description

@rivafarabi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions