forked from freeCodeCamp/freeCodeCamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate main manifest generation from sub manifests
in dev mode always pull manifest on each request add manifest build to gulp build task add react bundle to manifest generation
- Loading branch information
Berkeley Martinez
authored and
Berkeley Martinez
committed
Aug 28, 2015
1 parent
64b63d7
commit 6c48395
Showing
11 changed files
with
144 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ coverage | |
.remote-sync.json | ||
|
||
server/*.bundle.js | ||
public/js/*.bundle.js | ||
public/js/bundle* | ||
|
||
*.map | ||
|
||
|
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
File renamed without changes.
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,3 @@ | ||
{ | ||
"main.css": "main-6645810137.css" | ||
} |
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,3 @@ | ||
{ | ||
"commonFramework.js": "commonFramework-f2a3a38931.js" | ||
} |
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,5 @@ | ||
{ | ||
"iFrameScripts.js": "iFrameScripts-fee9f17adb.js", | ||
"main.js": "main-c4d88948ff.js", | ||
"plugin.js": "plugin-4564d5d4ec.js" | ||
} |
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,3 @@ | ||
{ | ||
"bundle.js": "bundle-5c9b5836a9.js" | ||
} |
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
import manifest from '../rev-manifest.json'; | ||
|
||
const __DEV__ = process.env.NODE_ENV === 'development'; | ||
export default function({ globalPrepend = '' } = {}) { | ||
|
||
function rev(scopedPrepend, asset) { | ||
function rev(manifest, scopedPrepend, asset) { | ||
return `${globalPrepend}${scopedPrepend}/${ manifest[asset] || asset }`; | ||
} | ||
const boundRev = rev.bind(null, manifest); | ||
|
||
return function(req, res, next) { | ||
res.locals.rev = rev; | ||
// in dev environment, we reread the manifest on every call | ||
// this means we do not need to restart server on every change to | ||
// client code | ||
if (__DEV__) { | ||
const manifest = require('../rev-manifest.json'); | ||
res.locals.rev = rev.bind(null, manifest); | ||
return next(); | ||
} | ||
|
||
// in production we take use the initially loaded manifest | ||
// since this should not change in production | ||
res.locals.rev = boundRev; | ||
next(); | ||
}; | ||
} |
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