Browse Source

Single babel config

pull/392/head
baarkerlounger 3 years ago
parent
commit
e04e3ffd89
  1. 8
      app/frontend/application.js
  2. 12
      babel.config.js
  3. 10
      package.json
  4. 5
      yarn.lock

8
app/frontend/application.js

@ -2,17 +2,17 @@
// present in this directory. You're encouraged to place your actual application logic in // present in this directory. You're encouraged to place your actual application logic in
// 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")
// Polyfills for IE // Polyfills for IE
import "core-js/features/promise" import "regenerator-runtime/runtime"
import "unfetch/polyfill"
import "@stimulus/polyfills" import "@stimulus/polyfills"
import "custom-event-polyfill"
// //
require.context("govuk-frontend/govuk/assets")
import { initAll } from "govuk-frontend"
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"
initAll() initAll()

12
babel.config.js

@ -41,6 +41,18 @@ module.exports = function(api) {
loose: true loose: true
} }
], ],
[
"@babel/plugin-proposal-private-methods",
{
loose: true
}
],
[
"@babel/plugin-proposal-private-property-in-object",
{
loose: true
}
],
[ [
'@babel/plugin-proposal-object-rest-spread', '@babel/plugin-proposal-object-rest-spread',
{ {

10
package.json

@ -21,6 +21,7 @@
"copy-webpack-plugin": "^10.2.4", "copy-webpack-plugin": "^10.2.4",
"core-js": "^3.21.1", "core-js": "^3.21.1",
"css-loader": "^6.7.1", "css-loader": "^6.7.1",
"custom-event-polyfill": "^1.0.7",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"govuk-frontend": "^4.0.1", "govuk-frontend": "^4.0.1",
"mini-css-extract-plugin": "^2.6.0", "mini-css-extract-plugin": "^2.6.0",
@ -46,15 +47,6 @@
"last 1 safari version" "last 1 safari version"
] ]
}, },
"babel": {
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-private-methods"
]
},
"scripts": { "scripts": {
"build": "webpack --config webpack.config.js" "build": "webpack --config webpack.config.js"
} }

5
yarn.lock

@ -1519,6 +1519,11 @@ cssesc@^3.0.0:
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
custom-event-polyfill@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz#9bc993ddda937c1a30ccd335614c6c58c4f87aee"
integrity sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==
date-fns@>=2.0.0: date-fns@>=2.0.0:
version "2.28.0" version "2.28.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.28.0.tgz#9570d656f5fc13143e50c975a3b6bbeb46cd08b2"

Loading…
Cancel
Save