From 45fc38077f49f1922db979fb686a1fdf7d11de90 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 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.dev.js | 21 ++++++++++++++++++++- config/webpack.config.prod.js | 13 ++++++++++--- scripts/build.js | 20 +++++++++++++++++++- scripts/start.js | 6 ++++++ 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 34bda5590a3..041c1c61318 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -18,6 +18,25 @@ var WatchMissingNodeModulesPlugin = require('../scripts/utils/WatchMissingNodeMo var paths = require('./paths'); var env = require('./env'); +// We use "homepage" field to infer "public path" at which the app is served. +// You may also use the environment variable CDN_URL to set the homepage to an absolute url +// this is useful if you are storing your bundle/assets on a different domain +// Webpack needs to know it to put the right