Browse Source

Add polyfill for fetch

jsbundling-with-webpack-modernizr
baarkerlounger 3 years ago
parent
commit
361309dc57
  1. 6
      app/frontend/application.js
  2. 1
      package.json
  3. 5
      yarn.lock

6
app/frontend/application.js

@ -3,10 +3,14 @@
// a relevant structure within app/javascript and only use these pack files to reference // a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled. // that code so it'll be compiled.
require.context("govuk-frontend/govuk/assets") require.context("govuk-frontend/govuk/assets")
// Polyfills for IE
import "core-js/features/promise" import "core-js/features/promise"
import "unfetch/polyfill"
//
import "./styles/application.scss" import "./styles/application.scss"
import "./controllers" // import "./controllers"
import "@hotwired/turbo-rails" import "@hotwired/turbo-rails"
import { initAll } from "govuk-frontend" import { initAll } from "govuk-frontend"

1
package.json

@ -27,6 +27,7 @@
"sass": "^1.49.9", "sass": "^1.49.9",
"sass-loader": "^12.6.0", "sass-loader": "^12.6.0",
"stimulus": "^3.0.0", "stimulus": "^3.0.0",
"unfetch": "^4.2.0",
"webpack": "^5.70.0", "webpack": "^5.70.0",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.9.2",
"webpack-remove-empty-scripts": "^0.7.3" "webpack-remove-empty-scripts": "^0.7.3"

5
yarn.lock

@ -2592,6 +2592,11 @@ to-regex-range@^5.0.1:
dependencies: dependencies:
is-number "^7.0.0" is-number "^7.0.0"
unfetch@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be"
integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==
unicode-canonical-property-names-ecmascript@^2.0.0: unicode-canonical-property-names-ecmascript@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"

Loading…
Cancel
Save