Skip to content

Commit

Permalink
update prototype guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhunter08 committed Aug 23, 2024
1 parent 9243b1b commit ba97059
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions docs/components/install-nhsapp-frontend-in-your-prototype.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,85 @@ Enter
npm install --save nhsapp-frontend
```

## Step 3

In your HTML editor, open

```sh
/app/assets/sass/application.scss
```

After

```sh
// Import NHS.UK frontend library
@import 'node_modules/nhsuk-frontend/packages/nhsuk';
```

Paste

```sh
// Import all styles from the NHS App frontend library
@import 'node_modules/nhsapp-frontend/dist/nhsapp/all';
```

## Step 4

In your root folder, open

```sh
/app.js
```

and find

```sh
appViews
```

After

```sh
path.join(__dirname, 'node_modules/nhsuk-frontend/packages/components'),
```

Add

```sh
path.join(__dirname, 'node_modules/nhsapp-frontend/dist'),
```

So it looks like this

```sh
const appViews = [
path.join(__dirname, 'app/views/'),
path.join(__dirname, 'node_modules/nhsuk-frontend/packages/components'),
path.join(__dirname, 'node_modules/nhsapp-frontend/dist'),
path.join(__dirname, 'docs/views/'),
];
```

## Step 5

In your root folder, open

```sh
/app.js
```

and find

```sh
app.use('/nhsuk-frontend', express.static(path.join(__dirname, 'node_modules/nhsuk-frontend/dist')));
```

and on the next line paste

```sh
app.use('/nhsapp-frontend', express.static(path.join(__dirname, 'node_modules/nhsapp-frontend/dist/nhsapp')));
```

Once you have installed NHS App frontend, all NHS App components should work in your prototype.

You will now have the latest version installed, later you can easily update to the latest NHS App frontend
Expand Down

0 comments on commit ba97059

Please sign in to comment.