From 768c9e89f273f013d205ee329e05d6a40a40f760 Mon Sep 17 00:00:00 2001 From: Shane Keulen Date: Tue, 13 Sep 2016 17:36:23 -0400 Subject: [PATCH] Reads CDN_URL to populate webpack publicPath closes #647 Previously we only allowed settings the pathname via the "homepage" key in package.json Allows user to configure the full base URL via a $CDN_URL env variable Development has the same behaviour. --- .../config/webpack.config.prod.js | 24 ++++++++++++------- packages/react-scripts/scripts/build.js | 9 ++++++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 5790e8e9551..72ebe9728b3 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -24,15 +24,21 @@ if (env['process.env.NODE_ENV'] !== '"production"') { throw new Error('Production builds must have NODE_ENV=production.'); } -// We use "homepage" field to infer "public path" at which the app is served. -// Webpack needs to know it to put the right