0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/frontend/asset-processor/rollup-plugins/discourse-index-search.js
David Taylor d1e1c02fcb DEV: Rename app/assets/javascripts/ -> frontend/
Commit created with `mv app/assets/javascripts frontend && git add .`
2025-10-22 16:24:11 +01:00

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))
);
},
};
}