Hi,
I'm new with nodeBB and I'm writing my first plugin.
I have a question that may be simple but I just can't figure out how to use lodash or underscore inside my client side JS file.
I have the file loaded, since I put this into plugin.json:
"scripts": [
"client/index.js"
],
So in my index.js file:
...
define('forum/client/plugins/my-plugin', [], function () {
'use strict';
require(['require', 'lodash'], function (require) {
var _ = require('lodash');
var Edit = {};
Edit.init = function () {
// an exemple code from lodash usage
_.map([4, 8], function(n) {
return n * n;
});
};
...
Can someone please point me to how to use lodash on my client side scripts?
Thanks