MihaiValentin/lunr-languages

Activate plugin in Reactjs

jaynakus opened this issue · 1 comments

How can I add this support in Reactjs where ES2015 and ES2016 are used.
Where modules are not required but imported.

tried these but didn't work

import lunr from 'lunr';
require('../node_modules/lung-languages/lunr.stemmer.support.js')(lunr)
import lunr from 'lunr';
import {} from 'lunr-languages';
var idx = lunr(function(){
   this.use(require('../node_modules/lung-languages/lunr.stemmer.support.js'))
});

This syntax would technically work (maybe you need to specify the full path)

  import elasticlunr from 'elasticlunr';
  import stemmerSupport from 'lunr-languages/lunr.stemmer.support.js';
  import de from 'lunr-languages/lunr.de.js';

  stemmerSupport(elasticlunr);
  de(elasticlunr);

elasticlunr(function () {
  this.use(elasticlunr.de);
});

However, you cannot use npm install lunr-languages because the package on npm only works with lunr. You need to include the files from the fork https://github.com/weixsong/lunr-languages