Browse Source

Unpleasant but works

pull/469/head
baarkerlounger 3 years ago committed by Dushan Despotovic
parent
commit
0056946aa3
  1. 8
      app/frontend/application.js
  2. 6
      app/frontend/controllers/govukfrontend_controller.js
  3. 7
      app/frontend/styles/application.scss
  4. 2
      webpack.config.js

8
app/frontend/application.js

@ -12,13 +12,9 @@ import "custom-event-polyfill"
import "intersection-observer"
//
// Import GOV.UK Frontend
import GOVUKFrontend from 'govuk-frontend'
// Import GOV.UK Prototype Components
import GOVUKPrototypeComponents from 'govuk-prototype-components'
require.context("govuk-frontend/govuk/assets")
import GOVUKFrontend from "govuk-frontend"
import GOVUKPrototypeComponents from "govuk-prototype-components"
import "./styles/application.scss"
import "./controllers"

6
app/frontend/controllers/govukfrontend_controller.js

@ -1,8 +1,10 @@
import { initAll } from "govuk-frontend";
import GOVUKFrontend from "govuk-frontend";
import GOVUKPrototypeComponents from "govuk-prototype-components"
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
connect() {
initAll()
GOVUKFrontend.initAll()
GOVUKPrototypeComponents.initAll()
}
}

7
app/frontend/styles/application.scss

@ -10,11 +10,8 @@ $govuk-font-url-function: frontend-font-url;
$govuk-image-url-function: frontend-image-url;
$govuk-global-styles: true;
// Import GOV.UK Frontend
@import "govuk-frontend/govuk/all";
// Import GOV.UK Prototype Components
// @import "govuk-prototype-components/x-govuk/all";
@import "node_modules/govuk-frontend/govuk/all";
@import "node_modules/govuk-prototype-components/x-govuk/all";
@import "accessible-autocomplete";
@import "button";

2
webpack.config.js

@ -43,7 +43,7 @@ module.exports = {
],
},
resolve: {
modules: ['node_modules', 'node_modules/govuk-frontend/govuk', 'node_modules/govuk-prototype-components/x-govuk']
modules: ['node_modules', 'node_modules/govuk-frontend/govuk']
},
output: {
filename: "[name].js",

Loading…
Cancel
Save