-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #468 from ParabolInc/s3-production
Adding S3 to host static assets
- Loading branch information
Showing
9 changed files
with
248 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* Setup webpack runtime public path loading, used for configuring | ||
* asset loading from our CDN: | ||
*/ | ||
|
||
/* eslint-disable camelcase, no-undef */ | ||
const getWebpackPublicPath = require('universal/utils/getWebpackPublicPath'); | ||
__webpack_public_path__ = getWebpackPublicPath(); | ||
module.exports = require('client/client.js'); | ||
/* eslint-enable */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* Setup webpack runtime public path loading, used for configuring | ||
* asset loading from our CDN: | ||
*/ | ||
|
||
/* eslint-disable camelcase, no-undef */ | ||
const getWebpackPublicPath = require('universal/utils/getWebpackPublicPath'); | ||
__webpack_public_path__ = getWebpackPublicPath(); | ||
module.exports = require('universal/routes/index.js'); | ||
/* eslint-enable */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
/* eslint-disable no-underscore-dangle */ | ||
const DEFAULT_PUBLIC_PATH = '/static/'; | ||
|
||
export default function getWebpackPublicPath() { | ||
let publicPath = DEFAULT_PUBLIC_PATH; | ||
|
||
if (typeof window !== 'undefined' && window.__ACTION__ && window.__ACTION__.cdn) { | ||
// client-side: | ||
publicPath = window.__ACTION__.cdn; | ||
} else if (typeof process !== 'undefined' && process.env.CDN_URL) { | ||
publicPath = process.env.CDN_URL; | ||
} | ||
|
||
return `${publicPath}${publicPath.endsWith('/') ? '' : '/'}`; | ||
} | ||
/* eslint-enable */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.