mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 05:43:41 +00:00
build(browser): integrate nx (#16712)
This commit is contained in:
494
apps/browser/project.json
Normal file
494
apps/browser/project.json
Normal file
@@ -0,0 +1,494 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"name": "browser",
|
||||||
|
"projectType": "application",
|
||||||
|
"sourceRoot": "apps/browser/src",
|
||||||
|
"tags": ["scope:browser", "type:app"],
|
||||||
|
"targets": {
|
||||||
|
"build": {
|
||||||
|
"executor": "@nx/webpack:webpack",
|
||||||
|
"outputs": ["{options.outputPath}"],
|
||||||
|
"defaultConfiguration": "chrome-dev",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/apps/browser",
|
||||||
|
"webpackConfig": "apps/browser/webpack.config.js",
|
||||||
|
"tsConfig": "apps/browser/tsconfig.build.json",
|
||||||
|
"main": "apps/browser/src/popup/main.ts",
|
||||||
|
"target": "web",
|
||||||
|
"compiler": "tsc"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"chrome": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/chrome",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "chrome",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chrome-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/chrome-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "chrome",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"edge": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/edge",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "edge",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"edge-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/edge-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "edge",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"firefox": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/firefox",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"firefox-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/firefox-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"firefox-mv2": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/firefox-mv2",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"firefox-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/firefox-mv2-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"opera": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/opera",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "opera",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"opera-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/opera-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "opera",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safari": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/safari",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safari-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/safari-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safari-mv2": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/safari-mv2",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safari-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/safari-mv2-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-chrome": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-chrome",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "chrome",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-chrome-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-chrome-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "chrome",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-edge": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-edge",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "edge",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-edge-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-edge-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "edge",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-firefox": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-firefox",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-firefox-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-firefox-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-firefox-mv2": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-firefox-mv2",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-firefox-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-firefox-mv2-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-opera": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-opera",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "opera",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-opera-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-opera-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "opera",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-safari": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-safari",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-safari-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-safari-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-safari-mv2": {
|
||||||
|
"mode": "production",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-safari-mv2",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-safari-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-safari-mv2-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"executor": "@nx/webpack:webpack",
|
||||||
|
"defaultConfiguration": "chrome-dev",
|
||||||
|
"options": {
|
||||||
|
"outputPath": "dist/apps/browser",
|
||||||
|
"webpackConfig": "apps/browser/webpack.config.js",
|
||||||
|
"tsConfig": "apps/browser/tsconfig.build.json",
|
||||||
|
"main": "apps/browser/src/popup/main.ts",
|
||||||
|
"target": "web",
|
||||||
|
"compiler": "tsc",
|
||||||
|
"watch": true
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"chrome-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/chrome-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "chrome",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"firefox-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/firefox-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"firefox-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/firefox-mv2-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safari-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/safari-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safari-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/safari-mv2-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"edge-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/edge-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "edge",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"opera-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/opera-dev",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "opera",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-chrome-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-chrome-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "chrome",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-firefox-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-firefox-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-firefox-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-firefox-mv2-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "firefox",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-safari-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-safari-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-safari-mv2-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-safari-mv2-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "safari",
|
||||||
|
"MANIFEST_VERSION": "2",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-edge-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-edge-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "edge",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"commercial-opera-dev": {
|
||||||
|
"mode": "development",
|
||||||
|
"outputPath": "dist/apps/browser/commercial-opera-dev",
|
||||||
|
"webpackConfig": "bitwarden_license/bit-browser/webpack.config.js",
|
||||||
|
"main": "bitwarden_license/bit-browser/src/popup/main.ts",
|
||||||
|
"tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json",
|
||||||
|
"env": {
|
||||||
|
"BROWSER": "opera",
|
||||||
|
"MANIFEST_VERSION": "3",
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"executor": "@nx/jest:jest",
|
||||||
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "apps/browser/jest.config.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nx/eslint:lint",
|
||||||
|
"outputs": ["{options.outputFile}"],
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": ["apps/browser/**/*.ts", "apps/browser/**/*.html"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
apps/browser/tsconfig.build.json
Normal file
5
apps/browser/tsconfig.build.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"include": ["src", "../../libs/common/src/autofill/constants"],
|
||||||
|
"exclude": ["**/*.stories.*", "**/*.spec.ts"]
|
||||||
|
}
|
||||||
@@ -4,5 +4,6 @@
|
|||||||
"src",
|
"src",
|
||||||
"../../libs/common/src/autofill/constants",
|
"../../libs/common/src/autofill/constants",
|
||||||
"../../libs/common/custom-matchers.d.ts"
|
"../../libs/common/custom-matchers.d.ts"
|
||||||
]
|
],
|
||||||
|
"exclude": ["**/*.stories.*"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,18 @@ const configurator = require("./config/config");
|
|||||||
const manifest = require("./webpack/manifest");
|
const manifest = require("./webpack/manifest");
|
||||||
const AngularCheckPlugin = require("./webpack/angular-check");
|
const AngularCheckPlugin = require("./webpack/angular-check");
|
||||||
|
|
||||||
module.exports.getEnv = function getEnv() {
|
module.exports.getEnv = function getEnv(params) {
|
||||||
const ENV = (process.env.ENV = process.env.NODE_ENV);
|
const ENV = params.env || (process.env.ENV = process.env.NODE_ENV);
|
||||||
const manifestVersion = process.env.MANIFEST_VERSION == 3 ? 3 : 2;
|
const manifestVersion = process.env.MANIFEST_VERSION == 3 ? 3 : 2;
|
||||||
const browser = process.env.BROWSER ?? "chrome";
|
const browser = process.env.BROWSER ?? "chrome";
|
||||||
|
|
||||||
return { ENV, manifestVersion, browser };
|
return { ENV, manifestVersion, browser };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DEFAULT_PARAMS = {
|
||||||
|
outputPath: path.resolve(__dirname, "build"),
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {{
|
* @param {{
|
||||||
* configName: string;
|
* configName: string;
|
||||||
@@ -29,15 +33,20 @@ module.exports.getEnv = function getEnv() {
|
|||||||
* entry: string;
|
* entry: string;
|
||||||
* };
|
* };
|
||||||
* tsConfig: string;
|
* tsConfig: string;
|
||||||
|
* outputPath?: string;
|
||||||
|
* mode?: string;
|
||||||
|
* env?: string;
|
||||||
* additionalEntries?: { [outputPath: string]: string }
|
* additionalEntries?: { [outputPath: string]: string }
|
||||||
* }} params - The input parameters for building the config.
|
* }} params - The input parameters for building the config.
|
||||||
*/
|
*/
|
||||||
module.exports.buildConfig = function buildConfig(params) {
|
module.exports.buildConfig = function buildConfig(params) {
|
||||||
|
params = { ...DEFAULT_PARAMS, ...params };
|
||||||
|
|
||||||
if (process.env.NODE_ENV == null) {
|
if (process.env.NODE_ENV == null) {
|
||||||
process.env.NODE_ENV = "development";
|
process.env.NODE_ENV = "development";
|
||||||
}
|
}
|
||||||
|
|
||||||
const { ENV, manifestVersion, browser } = module.exports.getEnv();
|
const { ENV, manifestVersion, browser } = module.exports.getEnv(params);
|
||||||
|
|
||||||
console.log(`Building Manifest Version ${manifestVersion} app - ${params.configName} version`);
|
console.log(`Building Manifest Version ${manifestVersion} app - ${params.configName} version`);
|
||||||
|
|
||||||
@@ -103,7 +112,7 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
{
|
{
|
||||||
loader: "babel-loader",
|
loader: "babel-loader",
|
||||||
options: {
|
options: {
|
||||||
configFile: "../../babel.config.json",
|
configFile: path.resolve(__dirname, "../../babel.config.json"),
|
||||||
cacheDirectory: ENV === "development",
|
cacheDirectory: ENV === "development",
|
||||||
compact: ENV !== "development",
|
compact: ENV !== "development",
|
||||||
},
|
},
|
||||||
@@ -130,43 +139,52 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
|
|
||||||
const plugins = [
|
const plugins = [
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/popup/index.ejs",
|
template: path.resolve(__dirname, "src/popup/index.ejs"),
|
||||||
filename: "popup/index.html",
|
filename: "popup/index.html",
|
||||||
chunks: ["popup/polyfills", "popup/vendor-angular", "popup/vendor", "popup/main"],
|
chunks: ["popup/polyfills", "popup/vendor-angular", "popup/vendor", "popup/main"],
|
||||||
browser: browser,
|
browser: browser,
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/notification/bar.html",
|
template: path.resolve(__dirname, "src/autofill/notification/bar.html"),
|
||||||
filename: "notification/bar.html",
|
filename: "notification/bar.html",
|
||||||
chunks: ["notification/bar"],
|
chunks: ["notification/bar"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/overlay/inline-menu/pages/button/button.html",
|
template: path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/overlay/inline-menu/pages/button/button.html",
|
||||||
|
),
|
||||||
filename: "overlay/menu-button.html",
|
filename: "overlay/menu-button.html",
|
||||||
chunks: ["overlay/menu-button"],
|
chunks: ["overlay/menu-button"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/overlay/inline-menu/pages/list/list.html",
|
template: path.resolve(__dirname, "src/autofill/overlay/inline-menu/pages/list/list.html"),
|
||||||
filename: "overlay/menu-list.html",
|
filename: "overlay/menu-list.html",
|
||||||
chunks: ["overlay/menu-list"],
|
chunks: ["overlay/menu-list"],
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/autofill/overlay/inline-menu/pages/menu-container/menu-container.html",
|
template: path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/overlay/inline-menu/pages/menu-container/menu-container.html",
|
||||||
|
),
|
||||||
filename: "overlay/menu.html",
|
filename: "overlay/menu.html",
|
||||||
chunks: ["overlay/menu"],
|
chunks: ["overlay/menu"],
|
||||||
}),
|
}),
|
||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{
|
{
|
||||||
from: manifestVersion == 3 ? "./src/manifest.v3.json" : "./src/manifest.json",
|
from:
|
||||||
|
manifestVersion == 3
|
||||||
|
? path.resolve(__dirname, "src/manifest.v3.json")
|
||||||
|
: path.resolve(__dirname, "src/manifest.json"),
|
||||||
to: "manifest.json",
|
to: "manifest.json",
|
||||||
transform: manifest.transform(browser),
|
transform: manifest.transform(browser),
|
||||||
},
|
},
|
||||||
{ from: "./src/managed_schema.json", to: "managed_schema.json" },
|
{ from: path.resolve(__dirname, "src/managed_schema.json"), to: "managed_schema.json" },
|
||||||
{ from: "./src/_locales", to: "_locales" },
|
{ from: path.resolve(__dirname, "src/_locales"), to: "_locales" },
|
||||||
{ from: "./src/images", to: "images" },
|
{ from: path.resolve(__dirname, "src/images"), to: "images" },
|
||||||
{ from: "./src/popup/images", to: "popup/images" },
|
{ from: path.resolve(__dirname, "src/popup/images"), to: "popup/images" },
|
||||||
{ from: "./src/autofill/content/autofill.css", to: "content" },
|
{ from: path.resolve(__dirname, "src/autofill/content/autofill.css"), to: "content" },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
new MiniCssExtractPlugin({
|
new MiniCssExtractPlugin({
|
||||||
@@ -196,33 +214,76 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
name: "main",
|
name: "main",
|
||||||
mode: ENV,
|
mode: ENV,
|
||||||
devtool: false,
|
devtool: false,
|
||||||
|
|
||||||
entry: {
|
entry: {
|
||||||
"popup/polyfills": "./src/popup/polyfills.ts",
|
"popup/polyfills": path.resolve(__dirname, "src/popup/polyfills.ts"),
|
||||||
"popup/main": params.popup.entry,
|
"popup/main": params.popup.entry,
|
||||||
"content/trigger-autofill-script-injection":
|
"content/trigger-autofill-script-injection": path.resolve(
|
||||||
"./src/autofill/content/trigger-autofill-script-injection.ts",
|
__dirname,
|
||||||
"content/bootstrap-autofill": "./src/autofill/content/bootstrap-autofill.ts",
|
"src/autofill/content/trigger-autofill-script-injection.ts",
|
||||||
"content/bootstrap-autofill-overlay": "./src/autofill/content/bootstrap-autofill-overlay.ts",
|
),
|
||||||
"content/bootstrap-autofill-overlay-menu":
|
"content/bootstrap-autofill": path.resolve(
|
||||||
"./src/autofill/content/bootstrap-autofill-overlay-menu.ts",
|
__dirname,
|
||||||
"content/bootstrap-autofill-overlay-notifications":
|
"src/autofill/content/bootstrap-autofill.ts",
|
||||||
"./src/autofill/content/bootstrap-autofill-overlay-notifications.ts",
|
),
|
||||||
"content/autofiller": "./src/autofill/content/autofiller.ts",
|
"content/bootstrap-autofill-overlay": path.resolve(
|
||||||
"content/auto-submit-login": "./src/autofill/content/auto-submit-login.ts",
|
__dirname,
|
||||||
"content/contextMenuHandler": "./src/autofill/content/context-menu-handler.ts",
|
"src/autofill/content/bootstrap-autofill-overlay.ts",
|
||||||
"content/content-message-handler": "./src/autofill/content/content-message-handler.ts",
|
),
|
||||||
"content/fido2-content-script": "./src/autofill/fido2/content/fido2-content-script.ts",
|
"content/bootstrap-autofill-overlay-menu": path.resolve(
|
||||||
"content/fido2-page-script": "./src/autofill/fido2/content/fido2-page-script.ts",
|
__dirname,
|
||||||
"content/ipc-content-script": "./src/platform/ipc/content/ipc-content-script.ts",
|
"src/autofill/content/bootstrap-autofill-overlay-menu.ts",
|
||||||
"notification/bar": "./src/autofill/notification/bar.ts",
|
),
|
||||||
"overlay/menu-button":
|
"content/bootstrap-autofill-overlay-notifications": path.resolve(
|
||||||
"./src/autofill/overlay/inline-menu/pages/button/bootstrap-autofill-inline-menu-button.ts",
|
__dirname,
|
||||||
"overlay/menu-list":
|
"src/autofill/content/bootstrap-autofill-overlay-notifications.ts",
|
||||||
"./src/autofill/overlay/inline-menu/pages/list/bootstrap-autofill-inline-menu-list.ts",
|
),
|
||||||
"overlay/menu":
|
"content/autofiller": path.resolve(__dirname, "src/autofill/content/autofiller.ts"),
|
||||||
"./src/autofill/overlay/inline-menu/pages/menu-container/bootstrap-autofill-inline-menu-container.ts",
|
"content/auto-submit-login": path.resolve(
|
||||||
"content/send-on-installed-message": "./src/vault/content/send-on-installed-message.ts",
|
__dirname,
|
||||||
"content/send-popup-open-message": "./src/vault/content/send-popup-open-message.ts",
|
"src/autofill/content/auto-submit-login.ts",
|
||||||
|
),
|
||||||
|
"content/contextMenuHandler": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/content/context-menu-handler.ts",
|
||||||
|
),
|
||||||
|
"content/content-message-handler": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/content/content-message-handler.ts",
|
||||||
|
),
|
||||||
|
"content/fido2-content-script": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/fido2/content/fido2-content-script.ts",
|
||||||
|
),
|
||||||
|
"content/fido2-page-script": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/fido2/content/fido2-page-script.ts",
|
||||||
|
),
|
||||||
|
"content/ipc-content-script": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/platform/ipc/content/ipc-content-script.ts",
|
||||||
|
),
|
||||||
|
"notification/bar": path.resolve(__dirname, "src/autofill/notification/bar.ts"),
|
||||||
|
"overlay/menu-button": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/overlay/inline-menu/pages/button/bootstrap-autofill-inline-menu-button.ts",
|
||||||
|
),
|
||||||
|
"overlay/menu-list": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/overlay/inline-menu/pages/list/bootstrap-autofill-inline-menu-list.ts",
|
||||||
|
),
|
||||||
|
"overlay/menu": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/autofill/overlay/inline-menu/pages/menu-container/bootstrap-autofill-inline-menu-container.ts",
|
||||||
|
),
|
||||||
|
"content/send-on-installed-message": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/vault/content/send-on-installed-message.ts",
|
||||||
|
),
|
||||||
|
"content/send-popup-open-message": path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"src/vault/content/send-popup-open-message.ts",
|
||||||
|
),
|
||||||
...params.additionalEntries,
|
...params.additionalEntries,
|
||||||
},
|
},
|
||||||
cache:
|
cache:
|
||||||
@@ -291,7 +352,7 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".js"],
|
extensions: [".ts", ".js"],
|
||||||
symlinks: false,
|
symlinks: false,
|
||||||
modules: [path.resolve("../../node_modules")],
|
modules: [path.resolve(__dirname, "../../node_modules")],
|
||||||
fallback: {
|
fallback: {
|
||||||
assert: false,
|
assert: false,
|
||||||
buffer: require.resolve("buffer/"),
|
buffer: require.resolve("buffer/"),
|
||||||
@@ -306,7 +367,7 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
filename: "[name].js",
|
filename: "[name].js",
|
||||||
chunkFilename: "assets/[name].js",
|
chunkFilename: "assets/[name].js",
|
||||||
webassemblyModuleFilename: "assets/[modulehash].wasm",
|
webassemblyModuleFilename: "assets/[modulehash].wasm",
|
||||||
path: path.resolve(__dirname, "build"),
|
path: params.outputPath,
|
||||||
clean: true,
|
clean: true,
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
@@ -335,7 +396,7 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
// Manifest V2 uses Background Pages which requires a html page.
|
// Manifest V2 uses Background Pages which requires a html page.
|
||||||
mainConfig.plugins.push(
|
mainConfig.plugins.push(
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/platform/background.html",
|
template: path.resolve(__dirname, "src/platform/background.html"),
|
||||||
filename: "background.html",
|
filename: "background.html",
|
||||||
chunks: ["vendor", "background"],
|
chunks: ["vendor", "background"],
|
||||||
}),
|
}),
|
||||||
@@ -344,19 +405,23 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
// Manifest V2 background pages can be run through the regular build pipeline.
|
// Manifest V2 background pages can be run through the regular build pipeline.
|
||||||
// Since it's a standard webpage.
|
// Since it's a standard webpage.
|
||||||
mainConfig.entry.background = params.background.entry;
|
mainConfig.entry.background = params.background.entry;
|
||||||
mainConfig.entry["content/fido2-page-script-delay-append-mv2"] =
|
mainConfig.entry["content/fido2-page-script-delay-append-mv2"] = path.resolve(
|
||||||
"./src/autofill/fido2/content/fido2-page-script-delay-append.mv2.ts";
|
__dirname,
|
||||||
|
"src/autofill/fido2/content/fido2-page-script-delay-append.mv2.ts",
|
||||||
|
);
|
||||||
|
|
||||||
configs.push(mainConfig);
|
configs.push(mainConfig);
|
||||||
} else {
|
} else {
|
||||||
// Firefox does not use the offscreen API
|
// Firefox does not use the offscreen API
|
||||||
if (browser !== "firefox") {
|
if (browser !== "firefox") {
|
||||||
mainConfig.entry["offscreen-document/offscreen-document"] =
|
mainConfig.entry["offscreen-document/offscreen-document"] = path.resolve(
|
||||||
"./src/platform/offscreen-document/offscreen-document.ts";
|
__dirname,
|
||||||
|
"src/platform/offscreen-document/offscreen-document.ts",
|
||||||
|
);
|
||||||
|
|
||||||
mainConfig.plugins.push(
|
mainConfig.plugins.push(
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: "./src/platform/offscreen-document/index.html",
|
template: path.resolve(__dirname, "src/platform/offscreen-document/index.html"),
|
||||||
filename: "offscreen-document/index.html",
|
filename: "offscreen-document/index.html",
|
||||||
chunks: ["offscreen-document/offscreen-document"],
|
chunks: ["offscreen-document/offscreen-document"],
|
||||||
}),
|
}),
|
||||||
@@ -372,11 +437,12 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
name: "background",
|
name: "background",
|
||||||
mode: ENV,
|
mode: ENV,
|
||||||
devtool: false,
|
devtool: false,
|
||||||
|
|
||||||
entry: params.background.entry,
|
entry: params.background.entry,
|
||||||
target: target,
|
target: target,
|
||||||
output: {
|
output: {
|
||||||
filename: "background.js",
|
filename: "background.js",
|
||||||
path: path.resolve(__dirname, "build"),
|
path: params.outputPath,
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
@@ -409,7 +475,7 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".js"],
|
extensions: [".ts", ".js"],
|
||||||
symlinks: false,
|
symlinks: false,
|
||||||
modules: [path.resolve("../../node_modules")],
|
modules: [path.resolve(__dirname, "../../node_modules")],
|
||||||
plugins: [new TsconfigPathsPlugin()],
|
plugins: [new TsconfigPathsPlugin()],
|
||||||
fallback: {
|
fallback: {
|
||||||
fs: false,
|
fs: false,
|
||||||
@@ -428,8 +494,11 @@ module.exports.buildConfig = function buildConfig(params) {
|
|||||||
backgroundConfig.plugins.push(
|
backgroundConfig.plugins.push(
|
||||||
new CopyWebpackPlugin({
|
new CopyWebpackPlugin({
|
||||||
patterns: [
|
patterns: [
|
||||||
{ from: "./src/safari/mv3/fake-background.html", to: "background.html" },
|
{
|
||||||
{ from: "./src/safari/mv3/fake-vendor.js", to: "vendor.js" },
|
from: path.resolve(__dirname, "src/safari/mv3/fake-background.html"),
|
||||||
|
to: "background.html",
|
||||||
|
},
|
||||||
|
{ from: path.resolve(__dirname, "src/safari/mv3/fake-vendor.js"), to: "vendor.js" },
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,13 +1,54 @@
|
|||||||
|
const path = require("path");
|
||||||
const { buildConfig } = require("./webpack.base");
|
const { buildConfig } = require("./webpack.base");
|
||||||
|
|
||||||
module.exports = buildConfig({
|
module.exports = (webpackConfig, context) => {
|
||||||
configName: "OSS",
|
// Detect if called by Nx (context parameter exists)
|
||||||
popup: {
|
const isNxBuild = context && context.options;
|
||||||
entry: "./src/popup/main.ts",
|
|
||||||
entryModule: "src/popup/app.module#AppModule",
|
if (isNxBuild) {
|
||||||
},
|
// Nx build configuration
|
||||||
background: {
|
const mode = context.options.mode || "development";
|
||||||
entry: "./src/platform/background.ts",
|
if (process.env.NODE_ENV == null) {
|
||||||
},
|
process.env.NODE_ENV = mode;
|
||||||
tsConfig: "tsconfig.json",
|
}
|
||||||
});
|
const ENV = (process.env.ENV = process.env.NODE_ENV);
|
||||||
|
|
||||||
|
// Set environment variables from Nx context
|
||||||
|
if (context.options.env) {
|
||||||
|
Object.keys(context.options.env).forEach((key) => {
|
||||||
|
process.env[key] = context.options.env[key];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return buildConfig({
|
||||||
|
configName: "OSS",
|
||||||
|
popup: {
|
||||||
|
entry: path.resolve(__dirname, "src/popup/main.ts"),
|
||||||
|
entryModule: "src/popup/app.module#AppModule",
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
entry: path.resolve(__dirname, "src/platform/background.ts"),
|
||||||
|
},
|
||||||
|
tsConfig: path.resolve(__dirname, "tsconfig.build.json"),
|
||||||
|
outputPath:
|
||||||
|
context.context && context.context.root
|
||||||
|
? path.resolve(context.context.root, context.options.outputPath)
|
||||||
|
: context.options.outputPath,
|
||||||
|
mode: mode,
|
||||||
|
env: ENV,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// npm build configuration
|
||||||
|
return buildConfig({
|
||||||
|
configName: "OSS",
|
||||||
|
popup: {
|
||||||
|
entry: path.resolve(__dirname, "src/popup/main.ts"),
|
||||||
|
entryModule: "src/popup/app.module#AppModule",
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
entry: path.resolve(__dirname, "src/platform/background.ts"),
|
||||||
|
},
|
||||||
|
tsConfig: "tsconfig.json",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
4
bitwarden_license/bit-browser/tsconfig.build.json
Normal file
4
bitwarden_license/bit-browser/tsconfig.build.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"exclude": ["**/*.stories.*", "**/*.spec.ts"]
|
||||||
|
}
|
||||||
@@ -1,13 +1,54 @@
|
|||||||
|
const path = require("path");
|
||||||
const { buildConfig } = require("../../apps/browser/webpack.base");
|
const { buildConfig } = require("../../apps/browser/webpack.base");
|
||||||
|
|
||||||
module.exports = buildConfig({
|
module.exports = (webpackConfig, context) => {
|
||||||
configName: "Commercial",
|
// Detect if called by Nx (context parameter exists)
|
||||||
popup: {
|
const isNxBuild = context && context.options;
|
||||||
entry: "../../bitwarden_license/bit-browser/src/popup/main.ts",
|
|
||||||
entryModule: "../../bitwarden_license/bit-browser/src/popup/app.module#AppModule",
|
if (isNxBuild) {
|
||||||
},
|
// Nx build configuration
|
||||||
background: {
|
const mode = context.options.mode || "development";
|
||||||
entry: "../../bitwarden_license/bit-browser/src/platform/background.ts",
|
if (process.env.NODE_ENV == null) {
|
||||||
},
|
process.env.NODE_ENV = mode;
|
||||||
tsConfig: "../../bitwarden_license/bit-browser/tsconfig.json",
|
}
|
||||||
});
|
const ENV = (process.env.ENV = process.env.NODE_ENV);
|
||||||
|
|
||||||
|
// Set environment variables from Nx context
|
||||||
|
if (context.options.env) {
|
||||||
|
Object.keys(context.options.env).forEach((key) => {
|
||||||
|
process.env[key] = context.options.env[key];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return buildConfig({
|
||||||
|
configName: "Commercial",
|
||||||
|
popup: {
|
||||||
|
entry: path.resolve(__dirname, "src/popup/main.ts"),
|
||||||
|
entryModule: "bitwarden_license/bit-browser/src/popup/app.module#AppModule",
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
entry: path.resolve(__dirname, "src/platform/background.ts"),
|
||||||
|
},
|
||||||
|
tsConfig: path.resolve(__dirname, "tsconfig.build.json"),
|
||||||
|
outputPath:
|
||||||
|
context.context && context.context.root
|
||||||
|
? path.resolve(context.context.root, context.options.outputPath)
|
||||||
|
: context.options.outputPath,
|
||||||
|
mode: mode,
|
||||||
|
env: ENV,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// npm build configuration
|
||||||
|
return buildConfig({
|
||||||
|
configName: "Commercial",
|
||||||
|
popup: {
|
||||||
|
entry: path.resolve(__dirname, "src/popup/main.ts"),
|
||||||
|
entryModule: "bitwarden_license/bit-browser/src/popup/app.module#AppModule",
|
||||||
|
},
|
||||||
|
background: {
|
||||||
|
entry: path.resolve(__dirname, "src/platform/background.ts"),
|
||||||
|
},
|
||||||
|
tsConfig: path.resolve(__dirname, "tsconfig.json"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user