1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

Add webpack-bundle-analyzer command using npx (#2955)

This commit is contained in:
Thomas Rittson 2022-06-28 07:32:17 +10:00 committed by GitHub
parent f60bc13f62
commit 3b3d60e102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

1
apps/web/.gitignore vendored
View File

@ -1,2 +1,3 @@
!dev-server.shared.pem
config/local.json
stats.json

View File

@ -7,6 +7,7 @@
"build:oss:watch": "webpack serve",
"build:bit:watch": "webpack serve -c ../../bitwarden_license/bit-web/webpack.config.js",
"build:bit:dev": "cross-env ENV=development npm run build:bit",
"build:bit:dev:analyze": "cross-env LOGGING=false webpack -c ../../bitwarden_license/bit-web/webpack.config.js --profile --json > stats.json && npx webpack-bundle-analyzer stats.json build/",
"build:bit:dev:watch": "cross-env ENV=development npm run build:bit:watch",
"build:bit:qa": "cross-env NODE_ENV=production ENV=qa npm run build:bit",
"build:bit:cloud": "cross-env NODE_ENV=production ENV=cloud npm run build:bit",

View File

@ -15,9 +15,12 @@ const pjson = require("./package.json");
const ENV = process.env.ENV == null ? "development" : process.env.ENV;
const NODE_ENV = process.env.NODE_ENV == null ? "development" : process.env.NODE_ENV;
const LOGGING = process.env.LOGGING != "false";
const envConfig = config.load(ENV);
config.log(envConfig);
if (LOGGING) {
config.log(envConfig);
}
const moduleRules = [
{
@ -205,8 +208,8 @@ const devServer =
{
key: "Content-Security-Policy",
value: `
default-src 'self';
script-src
default-src 'self';
script-src
'self'
'sha256-ryoU+5+IUZTuUyTElqkrQGBJXr1brEv6r2CA62WUw8w='
https://js.stripe.com
@ -255,7 +258,7 @@ const devServer =
https://*.blob.core.windows.net
https://app.simplelogin.io/api/alias/random/new
https://app.anonaddy.com/api/v1/aliases;
object-src
object-src
'self'
blob:;`,
},