mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-22 16:29:09 +01:00
Ensure Angular is running as production (#1093)
This commit is contained in:
parent
d31150c7a1
commit
35d6a28c94
@ -10,7 +10,7 @@ require('src/scss/styles.scss');
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ require('../scss/styles.scss');
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ if (!Element.prototype.matches && (Element.prototype as any).msMatchesSelector)
|
||||
Element.prototype.matches = (Element.prototype as any).msMatchesSelector;
|
||||
}
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// Production
|
||||
} else {
|
||||
// Development and test
|
||||
|
@ -47,7 +47,7 @@ export class AddCreditComponent implements OnInit {
|
||||
|
||||
constructor(private userService: UserService, private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService) {
|
||||
if (platformUtilsService.isDev()) {
|
||||
if (process.env.ENV !== 'production' || platformUtilsService.isDev()) {
|
||||
this.ppButtonFormAction = WebConstants.paypal.buttonActionSandbox;
|
||||
this.ppButtonBusinessId = WebConstants.paypal.businessIdSandbox;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ export class PaymentComponent implements OnInit {
|
||||
this.stripeScript.src = 'https://js.stripe.com/v3/';
|
||||
this.stripeScript.async = true;
|
||||
this.stripeScript.onload = () => {
|
||||
this.stripe = (window as any).Stripe(process.env.ENV === 'production' ?
|
||||
this.stripe = (window as any).Stripe(process.env.ENV === 'production' && !platformUtilsService.isDev() ?
|
||||
WebConstants.stripeLiveKey : WebConstants.stripeTestKey);
|
||||
this.stripeElements = this.stripe.elements();
|
||||
this.setStripeElement();
|
||||
@ -126,8 +126,8 @@ export class PaymentComponent implements OnInit {
|
||||
if (this.method === PaymentMethodType.PayPal) {
|
||||
window.setTimeout(() => {
|
||||
(window as any).braintree.dropin.create({
|
||||
authorization: this.platformUtilsService.isDev() ?
|
||||
WebConstants.btSandboxKey : WebConstants.btProductionKey,
|
||||
authorization: process.env.ENV === 'production' ?
|
||||
WebConstants.btProductionKey : WebConstants.btSandboxKey,
|
||||
container: '#bt-dropin-container',
|
||||
paymentOptionPriority: ['paypal'],
|
||||
paypal: {
|
||||
|
@ -249,7 +249,7 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
||||
}
|
||||
|
||||
isDev(): boolean {
|
||||
return process.env.ENV === 'development';
|
||||
return process.env.NODE_ENV === 'development';
|
||||
}
|
||||
|
||||
isSelfHost(): boolean {
|
||||
|
@ -135,6 +135,7 @@ const plugins = [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'ENV': JSON.stringify(ENV),
|
||||
'NODE_ENV': NODE_ENV === 'production' ? 'production' : 'development',
|
||||
'SELF_HOST': JSON.stringify(process.env.SELF_HOST === 'true' ? true : false),
|
||||
'APPLICATION_VERSION': JSON.stringify(pjson.version),
|
||||
'CACHE_TAG': JSON.stringify(Math.random().toString(36).substring(7)),
|
||||
|
Loading…
Reference in New Issue
Block a user