Only Load JS Files for Polyfills (#9628)

* Adding native-url package

* Bumping native-url version

* Upgrading native-url

* Logging stats object for debugging

* Logging stats object for debugging

* Adding try catch to the error lines

* Experimenting with regex

* Experimenting with regex

* Experimenting with regex

* Testing regex changes

* Fixing defer-script test case to not include polyfill.js

* Meging changes with existing polyfill work

* Bumping version

* adjust webpack config

* Reduce size in size test

* Remove 1kb from legacy

* Bumping native-url version, includes fix for IE11

* Update lock file

* Updating native-url, fixes issue on IE11

* Fix sourcemap being added in document
This commit is contained in:
Janicklas Ralph 2019-12-05 07:59:49 -08:00 committed by Joe Haddad
parent b6bdab57c9
commit 9bf48687a7

View file

@ -624,7 +624,9 @@ export class NextScript extends Component<OriginProps> {
const { _devOnlyInvalidateCacheQueryString } = this.context
return polyfillFiles
.filter(polyfill => !/\.module\.js$/.test(polyfill))
.filter(
polyfill => polyfill.endsWith('.js') && !/\.module\.js$/.test(polyfill)
)
.map(polyfill => (
<script
key={polyfill}