gatsby-plugin-flexsearch-lang
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -44,5 +44,5 @@ const _ = require('lodash') | ||
if (lng === 'en') { | ||
require('./lang/en') | ||
require('./lang/en')(global.FlexSearch) | ||
} else if (lng === 'de') { | ||
require('./lang/en') | ||
require('./lang/en')(global.FlexSearch) | ||
} else { | ||
@@ -91,9 +91,7 @@ console.error( | ||
fullIndex[lng] = { | ||
fs.writeFileSync(`public/flexsearch_index__${lng}.json`, JSON.stringify({ | ||
index: indexStore, | ||
store, | ||
} | ||
store | ||
})); | ||
}) | ||
fs.writeFileSync('public/flexsearch_index.json', JSON.stringify(fullIndex)) | ||
} |
// | ||
import useFlexSearch from './hooks/flexsearch'; | ||
export { useFlexSearch }; |
@@ -1,7 +0,3 @@ | ||
/** @define {boolean} */ const SUPPORT_LANG_DE = true | ||
if (SUPPORT_LANG_DE) { | ||
// noinspection ThisExpressionReferencesGlobalObjectJS | ||
;(function(root) { | ||
FlexSearch.registerLanguage( | ||
module.exports = (FlexSearch) => { | ||
FlexSearch.registerLanguage( | ||
'de', | ||
@@ -173,4 +169,3 @@ /** @const */ { | ||
} | ||
) | ||
})(this) | ||
} | ||
); | ||
}; |
@@ -1,7 +0,3 @@ | ||
/** @define {boolean} */ const SUPPORT_LANG_EN = true | ||
if (SUPPORT_LANG_EN) { | ||
// noinspection ThisExpressionReferencesGlobalObjectJS | ||
;(function(root) { | ||
FlexSearch.registerLanguage( | ||
module.exports = (FlexSearch) => { | ||
FlexSearch.registerLanguage( | ||
'en', | ||
@@ -277,4 +273,3 @@ /** @const */ { | ||
} | ||
) | ||
})(this) | ||
} | ||
); | ||
}; |
{ | ||
"name": "gatsby-plugin-flexsearch-lang", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Search for Gatsby.js using FlexSearch.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
19359
599