Skip to content

Commit

Permalink
Add Subresource Integrity support (facebook#1176)
Browse files Browse the repository at this point in the history
* Add Subresource Integrity support

* Pin dependency
  • Loading branch information
Vincenzo Chianese authored and randycoulman committed May 8, 2017
1 parent 6df9012 commit ca876ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var SubresourceIntegrityPlugin = require('webpack-subresource-integrity');
var url = require('url');
var paths = require('./paths');
var getClientEnvironment = require('./env');
Expand Down Expand Up @@ -277,6 +278,10 @@ module.exports = {
// having to parse `index.html`.
new ManifestPlugin({
fileName: 'asset-manifest.json'
}),
// Generate and inject subresources hashes in the final `index.html`.
new SubresourceIntegrityPlugin({
hashFuncNames: ['sha256', 'sha384']
})
],
// ZEAL: Configure resolving imports from client root
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"webpack": "1.13.2",
"webpack-dev-server": "1.16.2",
"webpack-manifest-plugin": "1.1.0",
"webpack-subresource-integrity": "0.7.0",
"whatwg-fetch": "1.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit ca876ed

Please sign in to comment.