Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use govuk_elements as a Node.js dependency #479

Closed
wants to merge 2 commits into from
Closed

Use govuk_elements as a Node.js dependency #479

wants to merge 2 commits into from

Conversation

RobinKnipe
Copy link

Added a version number to `package.json'.

Allows the project to be installed as a dependency with NPM.

Tested by inclusion into another project.
This project can now be added as a dependency in any Node.js project as described in the following steps:

  • install the dependency
npm install --save alphagov/govuk_elements
  • require the code
require('govuk-elements/assets/javascripts/govuk/details.polyfill');

About the change:

  • New feature (non-breaking change which adds functionality)

  • My change requires a change to the documentation.

  • I have updated the documentation accordingly.

  • I have read the CONTRIBUTING document.

Add a section showing how to include `govuk_elements` in Node.js projects.
@gemmaleigh
Copy link
Contributor

Hi @RobinKnipe,

Thanks for this. If you'd like to use GOV.UK elements - the sass files are available as an NPM package.

https://github.com/alphagov/govuk_elements/tree/master/packages/govuk-elements-sass

The govuk_elements application isn't intended to be included as a dependency in this way, that's why the package.json file in the root isn't versioned.

I'm not sure it's a good idea to require the entire app as a dependency to include a single file.

I'll raise an issue to move the details polyfill to the govuk_frontend_toolkit, where the rest of our shared JavaScript lives.

@gemmaleigh
Copy link
Contributor

We have an issue already: #400.

Sorry there hasn't been any movement on it, will try to prioritise it!

@RobinKnipe
Copy link
Author

Hi @gemmaleigh - thanks for getting back to me. I'm happy to get the polyfill from the govuk_frontend_toolkit if that's easier. I'll close this PR...

@RobinKnipe RobinKnipe closed this Jun 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants