Skip to content

Conversation

@robertknight
Copy link
Contributor

Add a generateManifest function that generates a JSON file mapping
relative asset URLs to cache-busted paths. This was extracted from the
scripts/gulp/manifest.js file present in several downstream projects
(client, lms, h) but revised to use Node's simpler promise-based file
access APIs instead of Node streams.

Add a `generateManifest` function that generates a JSON file mapping
relative asset URLs to cache-busted paths. This was extracted from the
`scripts/gulp/manifest.js` file present in several downstream projects
(client, lms, h) but revised to use Node's simpler promise-based file
access APIs instead of Node streams.
Comment on lines +3 to +5
import * as path from 'path';

import glob from 'glob';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import * as path from 'path';
import glob from 'glob';
import glob from 'glob';
import * as path from 'path';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention for imports in scripts that run in Node is:

// Node dependencies

// Third-party dependencies

// Local dependencies

This is similar to how Python lists standard library imports, followed by third-party imports, followed by vendor imports. Here path is a Node dep and glob is a third-party dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification!

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.

3 participants