Open yujonglee opened 1 month ago
export default function plugin(_context, options) { const { indexOnly = false } = options; let generatedPath = null; const config = { name: "docusaurus-plugin-pagefind-canary", async contentLoaded({ actions }) { actions.setGlobalData({ options }); }, + configureWebpack(config) { + generatedPath = config.resolve.alias["@generated"]; + return {}; + }, async postBuild({ routesPaths = [], outDir, baseUrl }) { const docs = getFilePaths(routesPaths, outDir, baseUrl, options); + await buildIndex(generatedPath, docs); }, }; if (indexOnly) { return config; } return { ...config, getThemePath() { return path.resolve(__dirname, "./theme"); }, }; }
In canary-provider-pagefind side, I tried checking url if it starts with @generated, and import without webpack ignore. But got can not access local file (<>/.docusaurus/pagefind..)
canary-provider-pagefind
@generated