forked from nextapps-de/flexsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.js
100 lines (79 loc) · 2.83 KB
/
webpack.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { RELEASE, SUPPORT_ASYNC, SUPPORT_DOCUMENT, SUPPORT_CACHE, SUPPORT_SERIALIZE, SUPPORT_WORKER, SUPPORT_ENCODER } from "./config.js";
import Document from "./document.js";
import Index from "./index.js";
import WorkerIndex from "./worker/index.js";
import { registerCharset, registerLanguage } from "./global.js";
import charset_default from "./lang/latin/default.js"
import charset_simple from "./lang/latin/simple.js"
import charset_balance from "./lang/latin/balance.js"
import charset_advanced from "./lang/latin/advanced.js"
import charset_extra from "./lang/latin/extra.js"
/** @export */ Document.prototype.add;
/** @export */ Document.prototype.append;
/** @export */ Document.prototype.search;
/** @export */ Document.prototype.update;
/** @export */ Document.prototype.remove;
/** @export */ Document.prototype.contain;
/** @export */ Document.prototype.get;
/** @export */ Document.prototype.set;
/** @export */ Index.prototype.add;
/** @export */ Index.prototype.append;
/** @export */ Index.prototype.search;
/** @export */ Index.prototype.update;
/** @export */ Index.prototype.remove;
/** @export */ Index.prototype.contain;
if(SUPPORT_CACHE){
/** @export */ Index.prototype.searchCache;
/** @export */ Document.prototype.searchCache;
}
if(SUPPORT_ASYNC){
/** @export */ Document.prototype.addAsync;
/** @export */ Document.prototype.appendAsync;
/** @export */ Document.prototype.searchAsync;
/** @export */ Document.prototype.updateAsync;
/** @export */ Document.prototype.removeAsync;
/** @export */ Index.prototype.addAsync;
/** @export */ Index.prototype.appendAsync;
/** @export */ Index.prototype.searchAsync;
/** @export */ Index.prototype.updateAsync;
/** @export */ Index.prototype.removeAsync;
}
if(SUPPORT_SERIALIZE){
/** @export */ Index.prototype.export;
/** @export */ Index.prototype.import;
/** @export */ Document.prototype.export;
/** @export */ Document.prototype.import;
}
if(SUPPORT_ENCODER){
registerCharset("latin:default", charset_default);
registerCharset("latin:simple", charset_simple);
registerCharset("latin:balance", charset_balance);
registerCharset("latin:advanced", charset_advanced);
registerCharset("latin:extra", charset_extra);
}
const FlexSearch = {
"Index": Index,
"Document": SUPPORT_DOCUMENT ? Document : null,
"Worker": SUPPORT_WORKER ? WorkerIndex : null,
"registerCharset": registerCharset,
"registerLanguage": registerLanguage
};
if(RELEASE !== "bundle.module" && RELEASE !== "light.module" && RELEASE !== "compact.module"){
let tmp;
if((tmp = self["define"]) && tmp["amd"]){
tmp([], function(){
return FlexSearch;
});
}
else if(self["exports"]){
self["exports"] = FlexSearch;
}
else{
/** @export */
self.FlexSearch = FlexSearch;
}
}
else{
/** @export */
self.FlexSearch = FlexSearch;
}