Skip to content

Commit

Permalink
Add Subresource Integrity support (#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 gaearon committed Dec 6, 2016
1 parent 8076567 commit 11cd813
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 @@ -259,6 +260,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']
})
],
// Some libraries import Node modules but don't use them in the browser.
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 @@ -64,6 +64,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 11cd813

Please sign in to comment.