gramex
gramex copied to clipboard
Gramex form components should support custom scripts & stylesheets
Let's add this kind of structure to config.json
"requires": [
"bootstrap@4",
"lodash@4",
],
"scripts": [
{"type": "npm", "url": "lodash/lodash.min.js"},
"jquery/dist/any-npm-link",
"/absolute-url-treated-as-is",
"https://full-url-treated-as-is"
],
"stylesheets": [
{"type": "npm", "url": "bootstrap/dist/bootstrap.min.css"},
"bootstrap/dist/bootstrap.min.css",
"/absolute-url-treated-as-is",
"https://full-url-treated-as-is"
]
- scripts and stylesheets are added to the component
requiresuses arequires.jsonthat maps each collection to a list of scripts and stylesheets that the component uses.requires.jsonlooks like this:
{
"bootstrap@4": {
"scripts": [
"jquery/dist/jquery.min.js",
"bootstrap/dist/bootstrap.bundle.min.js"
],
"stylesheets": [
"bootstrap/dist/bootstrap.min.css"
]
},
"lodash@4": {
}
}
@bkamapantula will be working on this