docusaurus/packages/docusaurus-theme-search-algolia/src/index.js
2020-04-05 17:38:12 +03:00

38 lines
914 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const path = require('path');
module.exports = function () {
return {
name: 'docusaurus-theme-search-algolia',
getThemePath() {
return path.resolve(__dirname, './theme');
},
configureWebpack() {
// Ensure that algolia docsearch styles is its own chunk.
return {
optimization: {
splitChunks: {
cacheGroups: {
algolia: {
name: 'algolia',
test: /algolia\.css$/,
chunks: `all`,
enforce: true,
// Set priority higher than docusaurus single-css extraction.
priority: 60,
},
},
},
},
};
},
};
};