generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrazzle.extend.js
29 lines (23 loc) · 947 Bytes
/
razzle.extend.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const path = require('path');
const makeLoaderFinder = require('razzle-dev-utils/makeLoaderFinder');
const modify = (config, { target, dev }, webpack) => {
const voltoSearchlibPath = path.dirname(
require.resolve('@eeacms/volto-searchlib'),
);
const searchlibPath = path.resolve(`${voltoSearchlibPath}/../searchlib`);
// because we load @eeacms/search "through the back door" , we need to
// instruct babel to include this package as well
const babelLoaderFinder = makeLoaderFinder('babel-loader');
const babelLoader = config.module.rules.find(babelLoaderFinder);
const { include } = babelLoader;
config.resolve.alias['@eeacms/search'] = searchlibPath;
include.push(searchlibPath);
if (config.devServer && config.devServer.watchOptions) {
config.devServer.watchOptions.ignored = /node_modules\/(?!(@plone\/volto|@elastic))/g;
}
return config;
};
module.exports = {
plugins: (plugs) => plugs,
modify,
};