I am trying to use CodeMirror in my site via the npm package with Meteor 1.3-rc.3, but I am having problems locaing/accessing the addons such as codemirror/addon/hint/show-hint.js.
I can get the basic CodeMirror() function ok:
import CodeMirror from ‘codemirror’; // So far so good.
The required codemirror.css does not get included because Meteor 1.3 does not support importing assets such as css files as described in Issue #6037 so I am doing the ugly symlink hack…
ln -s …/node_modules/codemirror/lib/codemirror.css .
That lets me get the CodeMirror() function which lets me make a CodeMirror div from a text area.
However, I can’t find a way to get the addons. For example, I would like the show-hint.js add-on, but trying deep imports like…
import cmh from ‘/codemirror/addon/hint/show-hint.js’
… fails (as reported in the browser console) with a “Cannot find module” error reported by modules-runtime:make Require()
I have tried other tricks like
import cmh from '…/node-modules/codemirror/addon/hint/show-hint.js"
using require(‘codemirror/addon/hint/show-hint.js’) directly
… but nothing seems to work.
Is npm module support in Meteor 1.3 supposed to allow access to sub-folders? If so, what is the magic syntax?