1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-26 06:13:46 +00:00
Files
browser/apps/desktop/webpack.config.js
renovate[bot] 622df1deaf [deps] Platform: Update electron-store to v11 (#16846)
* [deps] Platform: Update electron-store to v11

* wip-fix: all imports failing due to nodenext switch

* fix: desktop tsconfig not working properly

Renderer tsConfigPath was wrong so it defaulted to the base `tsconfig.json` which
included every single sourcefile into the angular artifact. This caused errors
with ESM modules which behave differently on node and needed a separate `tsconfig.json`
configuration.

* fix: revert some of the changes made to tools code

* fix: ESM import in tests

* chore: use consistent path

* feat: actually use custom tsconfig for preload

* fix: use correct entry point in tsconfig.main.json

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
2026-01-13 08:04:40 -07:00

44 lines
1.5 KiB
JavaScript

const path = require("path");
const { buildConfig } = require("./webpack.base");
module.exports = (webpackConfig, context) => {
const isNxBuild = context && context.options;
if (isNxBuild) {
return buildConfig({
configName: "OSS",
renderer: {
entry: path.resolve(__dirname, "src/app/main.ts"),
entryModule: "src/app/app.module#AppModule",
tsConfig: path.resolve(context.context.root, "apps/desktop/tsconfig.renderer.json"),
},
main: {
entry: path.resolve(__dirname, "src/entry.ts"),
tsConfig: path.resolve(context.context.root, "apps/desktop/tsconfig.main.json"),
},
preload: {
entry: path.resolve(__dirname, "src/preload.ts"),
tsConfig: path.resolve(context.context.root, "apps/desktop/tsconfig.preload.json"),
},
outputPath: path.resolve(context.context.root, context.options.outputPath),
});
} else {
return buildConfig({
configName: "OSS",
renderer: {
entry: path.resolve(__dirname, "src/app/main.ts"),
entryModule: "src/app/app.module#AppModule",
tsConfig: path.resolve(__dirname, "tsconfig.renderer.json"),
},
main: {
entry: path.resolve(__dirname, "src/entry.ts"),
tsConfig: path.resolve(__dirname, "tsconfig.main.json"),
},
preload: {
entry: path.resolve(__dirname, "src/preload.ts"),
tsConfig: path.resolve(__dirname, "tsconfig.preload.json"),
},
});
}
};