File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11/*
22 * This file should only contain environment variables that are non-secret.
33 */
4- const isProduction = process . env . NODE_ENV === 'production ' ;
4+ const isProduction = process . env . PRODUCTION_DEPLOYMENT === 'true ' ;
55
66// These are all exposed by the client, so there's no way to protect them anyways.
77export const clientTokens = isProduction
Original file line number Diff line number Diff line change 99// ***********************************************************
1010const { addMatchImageSnapshotPlugin } = require ( 'cypress-image-snapshot/plugin' ) ;
1111const webpack = require ( '@cypress/webpack-preprocessor' ) ;
12+ const { DefinePlugin } = require ( 'webpack' ) ;
1213// This function is called when a project is opened or re-opened (e.g. due to
1314// the project's config changing)
1415// eslint-disable-next-line no-unused-vars
@@ -33,6 +34,14 @@ module.exports = (on, config) => {
3334 alias : require ( '../../pathAliases' ) ,
3435 extensions : [ '.js' , '.ts' , '.tsx' ] ,
3536 } ,
37+ plugins : [
38+ new DefinePlugin ( {
39+ 'process.env' : {
40+ NODE_ENV : JSON . stringify ( process . env . NODE_ENV ) ,
41+ PRODUCTION_DEPLOYMENT : JSON . stringify ( false ) ,
42+ } ,
43+ } ) ,
44+ ] ,
3645 module : {
3746 rules : [
3847 {
@@ -53,5 +62,8 @@ module.exports = (on, config) => {
5362 watchOptions : { } ,
5463 } ) ,
5564 ) ;
65+
66+ console . log ( process . env ) ;
67+
5668 return config ;
5769} ;
You can’t perform that action at this time.
0 commit comments