mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 11:13:44 +00:00
- Add project.json with build, serve, test, and lint targets - Support both OSS and Bit configurations via Nx configurations - Maintain backward compatibility with existing npm build scripts - Update webpack configs to work with both Nx and direct webpack CLI calls - Enable nx build cli --configuration=[oss|oss-dev|bit|bit-dev] commands - Enable nx serve cli for development workflow with watch mode - Preserve all existing npm run build:* commands for compatibility
26 lines
807 B
JavaScript
26 lines
807 B
JavaScript
const path = require("path");
|
|
const { getSharedConfig } = require("./webpack.shared");
|
|
|
|
module.exports = (webpackConfig, context) => {
|
|
// Set environment based on context mode
|
|
const mode = context.options.mode || "development";
|
|
if (process.env.NODE_ENV == null) {
|
|
process.env.NODE_ENV = mode;
|
|
}
|
|
const ENV = (process.env.ENV = process.env.NODE_ENV);
|
|
|
|
// Nx-specific path configuration
|
|
const options = {
|
|
env: ENV,
|
|
mode: mode,
|
|
entryPoint: context.options.main || "apps/cli/src/bw.ts",
|
|
outputPath: path.resolve(context.context.root, context.options.outputPath),
|
|
modulesPath: [path.resolve("node_modules")],
|
|
tsconfigPath: "tsconfig.base.json",
|
|
localesPath: "apps/cli/src/locales",
|
|
externalsModulesDir: "node_modules",
|
|
};
|
|
|
|
return getSharedConfig(options);
|
|
};
|