Skip to content

Conversation

@jbottigliero
Copy link
Member

This will, in theory, will add support for downstream codebases to include arbitrary dependencies and devDependencies into a generator context. Using this functionality, in combination with content or overrides means you can easily include package-based code in custom content.

The below example shows how this would look to downstream codebases – the key thing to note is that this appears no different than installing and using a dependency as you would in any project using NPM.

content/
 index.mdx
static.json
package.json
// static.json
{
  "_static": {
    "generator": {
      "name": "@globus/static-search-portal"
    }
  },
  "data": {
    "version": "1.0.0",
    "attributes": { /* ... */ } 
   }
}
// package.json
{
    "dependencies": {
        "@globus/static-search-portal": "1.5.0",
        "d3": "^7.9.0"
    }
}
// content/index.mdx
import * as d3 from 'd3';

# Welcome!

{{(function(){ console.log(d3);}()}}

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