mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
16 lines
424 B
JavaScript
Vendored
16 lines
424 B
JavaScript
Vendored
export default function discourseIndexSearch() {
|
|
return {
|
|
name: "discourse-index-search",
|
|
async resolveId(source, context) {
|
|
if (source.match(/\.\w+$/) || source.match(/\/index$/)) {
|
|
// Already has an extension or is an index
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
(await this.resolve(source, context)) ||
|
|
(await this.resolve(`${source}/index`, context))
|
|
);
|
|
},
|
|
};
|
|
}
|