@@ -57,7 +57,7 @@ function generateExternals() {
5757
5858const EXTERNALS = generateExternals ( ) ;
5959
60- function createPlugins ( isDevelopment , outputPath , mode , env , rebuild = false ) {
60+ function createPlugins ( isDevelopment , outputPath , mode , env , rebuild = false , buildTarget = '' ) {
6161 const plugins = [ ] ;
6262
6363 plugins . push (
@@ -222,6 +222,7 @@ function createPlugins(isDevelopment, outputPath, mode, env, rebuild = false) {
222222 new webpack . DefinePlugin ( {
223223 'process.env.NODE_ENV' : JSON . stringify ( mode ) ,
224224 'process.env.AWS_ENV' : JSON . stringify ( env ) ,
225+ 'process.env.BUILD_TARGET' : JSON . stringify ( buildTarget ) ,
225226 } ) ,
226227 ) ;
227228
@@ -276,6 +277,7 @@ module.exports = (env = {}) => {
276277 const mode = env . mode ;
277278 let awsEnv = env . env ;
278279 const rebuild = env . rebuild === 'true' || env . rebuild === true ;
280+ const buildTarget = env . buildTarget || '' ;
279281
280282 // Validate mode
281283 const validModes = [ 'development' , 'production' ] ;
@@ -329,6 +331,6 @@ module.exports = (env = {}) => {
329331 chunks : 'all' ,
330332 } ,
331333 } ,
332- plugins : createPlugins ( isDevelopment , outputPath , mode , awsEnv , rebuild ) ,
334+ plugins : createPlugins ( isDevelopment , outputPath , mode , awsEnv , rebuild , buildTarget ) ,
333335 } ;
334336} ;
0 commit comments