-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesign.config.js
81 lines (74 loc) · 2.29 KB
/
design.config.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* Configuration file for design library.
* It allows to use svg icons in @oacore/design components and everywhere else.
*
* Exported structure should match this scheme:
*
* {
* icons: <object>{
* path: string, // base path, icons with relative path
* // resolves from it
* files: array<string> // relative/absolute path to each icon
* },
* output: <object>{
* path: string, // destination folder
* publicPath: string, // the URL where assets are hosted,
* // `output.path` base URL
* icons: <object>{
* files: string, // folder where optimised icons are written,
* // absolute or relative to `output.path`
* sprite: string, // sprite file name, absolute or relative
* //to `output.path`
* }
* }
* }
*/
const path = require('path')
const isDev = process.env.NODE_ENV !== 'production'
const icons = [
'alert-circle-outline',
'check',
'open-in-new',
'magnify',
'menu',
'window-close',
'pencil',
'account',
'information-outline',
'office-building',
path.resolve(__dirname, './assets/core-symbol.svg'),
path.resolve(__dirname, './assets/copy-document.svg'),
path.resolve(__dirname, './assets/collaborators.svg'),
path.resolve(__dirname, './assets/writing.svg'),
path.resolve(__dirname, './assets/jisc-logo.svg'),
path.resolve(__dirname, './assets/ou-logo.svg'),
path.resolve(__dirname, './assets/twitter.svg'),
path.resolve(__dirname, './assets/linkedin.svg'),
path.resolve(__dirname, './assets/github.svg'),
path.resolve(__dirname, './assets/bin.svg'),
path.resolve(__dirname, './assets/active-arrow.svg'),
path.resolve(__dirname, './assets/metadata-validator.svg'),
path.resolve(__dirname, './assets/deduplication.svg'),
path.resolve(__dirname, './assets/fresh-finds.svg'),
]
// icons used in documentation
if (isDev) icons.push('file-check')
const iconsRoot = path.join(
path.dirname(require.resolve('@mdi/svg/package.json')),
'./svg'
)
const config = {
icons: {
path: iconsRoot,
files: icons,
},
output: {
path: path.join(__dirname, 'public'),
publicPath: '/',
icons: {
files: 'icons',
sprite: 'icons.svg',
},
},
}
module.exports = config