How do I enable individual codemirror mode files using gazebo?
I am creating a fullstack angular app using Yeoman angular Fullstack which includes a conversation.
In this application, I am using a component called Codemirror, which has its own bower package called codemirror
, and another bower package called angular-ui-codemirror
.
Inside the normal codemirror
bower package, there are additional mode files in a directory named mode
, and in a normal non-bower managed application, I'll just add the necessary script tags to mine index.html
, but here I want to get it right using conversation if possible.
How do I put this single file into codemirror mode using a gazebo?
source to share
Since angular-fullstack uses wiredep to nest your dependencies in the bar, you can override the main
codemirror package's support property to include additional files from the directory mode
.
To do this, you have two options:
- Override in
Gruntfile
- Override directly in
bower.json
I will recommend the second solution for you, because with a single glance at your manifest file you can see which files will be included, it is more verbose and clear.
Here's an example with a bower.json
and including an additional file asterisk.js
, but it's pretty much the same as using the option Gruntfile
.
{
"name": "testingPurposes",
"dependencies": {
"codemirror": "~4.7.0"
},
"overrides": {
"codemirror": {
"main": ["lib/codemirror.js", "lib/codemirror.css", "mode/asterisk/asterisk.js"]
}
}
}
Then when you run a task using wiredep
one, for example grunt serve
, you will see an additional file included in your index.html
.
source to share