From b7d0195ea9ccf7a2914ca75491492430930a48c7 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Mon, 9 Oct 2017 16:34:51 -0700 Subject: [PATCH] Move CDN Url into deploy script --- package.json | 1 - scripts/deploy.sh | 2 +- webpack.production.config.js | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7676d1ab..e961a44b 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "url-loader": "^0.5.7", "webpack-dev-server": "^2.7.1" }, - "cdnUrl": "https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/", "dependencies": { "babel": "^6.23.0", "babel-plugin-transform-object-rest-spread": "^6.20.2", diff --git a/scripts/deploy.sh b/scripts/deploy.sh index c1a3f20f..acea75af 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -26,7 +26,7 @@ echo "Run tests" ( cd $NEW_CLONE && yarn run test ) echo "Build the webpack bundle" -( cd $NEW_CLONE && yarn run build ) +( cd $NEW_CLONE && CDN_URL=https://d38dnrh1liu4f5.cloudfront.net/projects/winamp2-js/ yarn run build ) echo "Cleaning up node_modules/ to save space" ( cd $NEW_CLONE && rm -r node_modules ) diff --git a/webpack.production.config.js b/webpack.production.config.js index be5b12a5..5878be33 100644 --- a/webpack.production.config.js +++ b/webpack.production.config.js @@ -1,7 +1,8 @@ -const { cdnUrl } = require("./package.json"); const config = require("./webpack.config"); const webpack = require("webpack"); +const cdnUrl = process.env.CDN_URL || "/"; + config.plugins = (config.plugins || []).concat([ new webpack.DefinePlugin({ "process.env": {