Skip to content

Commit

Permalink
Add some example polyfills.
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoda committed Jan 14, 2018
1 parent ce047df commit fa61727
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/with-polyfills/client/polyfills.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/* eslint no-extend-native: 0 */

// Add your polyfills
// This files runs at the very beginning (even before React and Next.js core)

console.log('Load your polyfills')

// core-js comes with Next.js. So, you can import it like below
import includes from 'core-js/library/fn/string/virtual/includes'
import repeat from 'core-js/library/fn/string/virtual/repeat'

String.prototype.includes = includes
String.prototype.repeat = repeat

0 comments on commit fa61727

Please sign in to comment.