Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2641

Improve regex for webpack.externals in Electron Example app

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Electron

      Problem

      Current regex requires user to put needed packages in allow-list all the time.

      Solution

      Wouldn't it better to do

      const path = require("node:path");
      const nodeExternals = require("webpack-node-externals");
      
      module.exports = {
          webpack: {
              configure: {
                  target: "electron-renderer",
                  externals: [
                      nodeExternals({
                          allowlist: [/^(?!.*(^realm)$)/i],
                          additionalModuleDirs: [path.resolve(__dirname, '../../../node_modules')],
                      }),
                  ],
              },
          },
      };
      
      

      so we basically say, pack everything except realm.

      Alternatives

      No response

      How important is this improvement for you?

      Fairly niche but nice to have anyway

      Feature would mainly be used with

      Atlas Device Sync

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: