Skip to content

Commit 455827c

Browse files
Timeralexdriaguine
authored andcommitted
Disable subresource integrity temporarily (facebook#1233)
1 parent cef0f63 commit 455827c

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

packages/react-scripts/config/webpack.config.prod.js

-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
1515
var ExtractTextPlugin = require('extract-text-webpack-plugin');
1616
var ManifestPlugin = require('webpack-manifest-plugin');
1717
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
18-
var SubresourceIntegrityPlugin = require('webpack-subresource-integrity');
1918
var url = require('url');
2019
var paths = require('./paths');
2120
var getClientEnvironment = require('./env');
@@ -81,10 +80,6 @@ module.exports = {
8180
// We don't currently advertise code splitting but Webpack supports it.
8281
filename: 'static/js/[name].[chunkhash:8].js',
8382
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
84-
// Given Webpack supports codesplit and production bundles are using
85-
// subresource integrity, it's important to make sure the attribute
86-
// set on async-loaded chunks is set to anonymous.
87-
crossOriginLoading: 'anonymous',
8883
// We inferred the "public path" (such as / or /my-project) from homepage.
8984
publicPath: publicPath
9085
},
@@ -273,10 +268,6 @@ module.exports = {
273268
// having to parse `index.html`.
274269
new ManifestPlugin({
275270
fileName: 'asset-manifest.json'
276-
}),
277-
// Generate and inject subresources hashes in the final `index.html`.
278-
new SubresourceIntegrityPlugin({
279-
hashFuncNames: ['sha256', 'sha384']
280271
})
281272
],
282273
// Some libraries import Node modules but don't use them in the browser.

packages/react-scripts/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"webpack": "1.14.0",
6565
"webpack-dev-server": "1.16.2",
6666
"webpack-manifest-plugin": "1.1.0",
67-
"webpack-subresource-integrity": "0.8.1",
6867
"whatwg-fetch": "1.0.0"
6968
},
7069
"devDependencies": {

packages/react-scripts/template/README.md

-12
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ You can find the most recent version of this guide [here](https://github.com/fac
6161
- [Troubleshooting](#troubleshooting)
6262
- [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
6363
- [`npm run build` silently fails](#npm-run-build-silently-fails)
64-
- [Subresource integrity checks fail](#subresource-integrity-checks-fail)
6564
- [Something Missing?](#something-missing)
6665

6766
## Updating to New Releases
@@ -1245,17 +1244,6 @@ There are also reports that *uninstalling* Watchman fixes the issue. So if nothi
12451244
12461245
It is reported that `npm run build` can fail on machines with no swap space, which is common in cloud environments. If [the symptoms are matching](https://github.com/facebookincubator/create-react-app/issues/1133#issuecomment-264612171), consider adding some swap space to the machine you’re building on, or build the project locally.
12471246
1248-
### Subresource integrity checks fail
1249-
1250-
[Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) digests are added to the build output files. For a particular scenario, these checks may fail when deployed. The files are built using `LF` characters, but if your deployment uses a Git repository for deployment (like Azure web sites) and the Git repository is set up to translate `LF` characters into `CR/LF` characters, then the checked out files will be different and the digests will be invalid.
1251-
1252-
To fix this, just add a `.gitattributes` file to your deployment repository that will ensure the build files are not modified when checked out:
1253-
1254-
```
1255-
*.css text eol=lf
1256-
*.js text eol=lf
1257-
```
1258-
12591247
## Something Missing?
12601248
12611249
If you have ideas for more “How To” recipes that should be on this page, [let us know](https://github.com/facebookincubator/create-react-app/issues) or [contribute some!](https://github.com/facebookincubator/create-react-app/edit/master/packages/react-scripts/template/README.md)

0 commit comments

Comments
 (0)