1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-30 16:23:53 +00:00

WIP bit-desktop entrypoints

Need to get preload and renderer set up in commercial webpack config,
otherwise it fails when running webpack.
This commit is contained in:
Derek Nance
2025-12-12 17:06:02 -06:00
parent 020b0e4ad9
commit b07d0ae39b
5 changed files with 40 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
"build:renderer": "cross-env NODE_ENV=production webpack --config webpack.config.js --config-name renderer",
"build:renderer:dev": "cross-env NODE_ENV=development webpack --config webpack.config.js --config-name renderer",
"build:renderer:watch": "cross-env NODE_ENV=development webpack --config webpack.config.js --config-name renderer --watch",
"build:bit:main": "cross-env NODE_ENV=production webpack --config ../../bitwarden_license/bit-desktop/webpack.config.js --config-name main",
"electron": "node ./scripts/start.js",
"electron:ignore": "node ./scripts/start.js --ignore-certificate-errors",
"flatpak:dev": "npm run clean:dist && electron-builder --dir -p never && flatpak-builder --force-clean --install --user ../../.flatpak/ ./resources/com.bitwarden.desktop.devel.yaml && flatpak run com.bitwarden.desktop",

View File

@@ -0,0 +1,8 @@
// implicitly execute the OSS entrypoint
import "@bitwarden/desktop/entry";
// TODO coalesce
// import {Main as OssMain} from "@bitwarden/desktop/main";
// export class Main extends OssMain
// { }

View File

@@ -0,0 +1,4 @@
{
"extends": "../../apps/desktop/tsconfig",
"files": ["../../bitwarden_license/bit-common/src/platform/sdk/sdk-alias.d.ts", "src/entry.ts"]
}

View File

@@ -0,0 +1,26 @@
const path = require("path");
const { buildConfig } = require("../../apps/desktop/webpack.base");
module.exports = (webpackConfig, context) => {
// Detect if called by Nx (context parameter exists)
const isNxBuild = context && context.options;
if (isNxBuild) {
return buildConfig({
configName: "Commercial",
main: {
entry: path.resolve(__dirname, "src/entry.ts"),
tsConfig: path.resolve(context.context.root, "bitwarden_license/bit-desktop/tsconfig.json"),
},
outputPath: path.resolve(context.context.root, context.options.outputPath),
});
} else {
return buildConfig({
configName: "Commercial",
main: {
entry: path.resolve(__dirname, "src/entry.ts"),
tsConfig: path.resolve(__dirname, "tsconfig.json"),
},
});
}
};

View File

@@ -34,6 +34,7 @@
"@bitwarden/common/*": ["./libs/common/src/*"],
"@bitwarden/components": ["./libs/components/src"],
"@bitwarden/core-test-utils": ["./libs/core-test-utils/src/index.ts"],
"@bitwarden/desktop/*": ["./apps/desktop/src/*"],
"@bitwarden/dirt-card": ["./libs/dirt/card/src"],
"@bitwarden/generator-components": ["./libs/tools/generator/components/src"],
"@bitwarden/generator-core": ["./libs/tools/generator/core/src"],