generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrazzle.extend.js
29 lines (25 loc) · 1.04 KB
/
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 plugins = (defaultPlugins) => {
return defaultPlugins;
};
const modify = (config, { target, dev }, webpack) => {
const themeConfigPath = `${__dirname}/theme/theme.config`;
config.resolve.alias['../../theme.config$'] = themeConfigPath;
config.resolve.alias['../../theme.config'] = themeConfigPath;
config.resolve.alias['../../theme'] = `${__dirname}/theme`;
const projectRootPath = path.resolve('.');
const themeLessPath = `${projectRootPath}/node_modules/@eeacms/volto-eea-design-system/theme`;
config.resolve.alias['eea-design-system-theme'] = dev
? `${projectRootPath}/src/addons/volto-eea-design-system/theme/themes/eea`
: `${themeLessPath}/themes/eea`;
const semanticLessPath = `${projectRootPath}/node_modules/semantic-ui-less`;
const hasDesignSystemInstalled = config.resolve.alias['eea-volto-themes'];
config.resolve.alias['eea-volto-theme-folder'] = hasDesignSystemInstalled
? themeLessPath
: semanticLessPath;
return config;
};
module.exports = {
plugins,
modify,
};