You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integration.md
+12-15Lines changed: 12 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,6 @@ For our examples, we'll assume the following `rev-manifest.json`:
12
12
}
13
13
```
14
14
15
-
16
15
## Approach #1 - Generate index.html during build
17
16
18
17
One approach to working with `rev-manifest.json` is to use a templating language, such as [handlebars](http://handlebarsjs.com), to generate an `index.html` file which contained your fingerprinted files embedded into the page.
@@ -38,33 +37,32 @@ The idea is to read in your app's `rev-manifest.json`, and use the non-fingerpri
// Read in our handlebars template, compile it using
59
58
// our manifest, and output it to index.html
60
59
returngulp.src('index.hbs')
61
-
.pipe(handlebars(manifest, handlebarOpts))
60
+
.pipe(handlebars(manifest, handlebarOptions))
62
61
.pipe(rename('index.html'))
63
62
.pipe(gulp.dest('public'));
64
63
};
65
64
```
66
65
67
-
68
66
## Approach #2 - AJAX in manifest, inject assets into the page
69
67
70
68
Another approach would be to make a AJAX request to get the manifest JSON blob, then use the manifest to programmatically find the fingerprinted path to any given asset.
@@ -75,23 +73,22 @@ For example, if you wanted to include your JavaScript files into the page:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
0 commit comments