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:
@@ -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",
|
||||
|
||||
8
bitwarden_license/bit-desktop/src/entry.ts
Normal file
8
bitwarden_license/bit-desktop/src/entry.ts
Normal 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
|
||||
// { }
|
||||
4
bitwarden_license/bit-desktop/tsconfig.json
Normal file
4
bitwarden_license/bit-desktop/tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "../../apps/desktop/tsconfig",
|
||||
"files": ["../../bitwarden_license/bit-common/src/platform/sdk/sdk-alias.d.ts", "src/entry.ts"]
|
||||
}
|
||||
26
bitwarden_license/bit-desktop/webpack.config.js
Normal file
26
bitwarden_license/bit-desktop/webpack.config.js
Normal 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"),
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user