mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-06 05:37:16 +02:00
38 lines
914 B
JavaScript
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,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
},
|
|
};
|
|
};
|