-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
node-scripts.config.js
75 lines (66 loc) · 2.73 KB
/
node-scripts.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
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
const npmscriptsConfig = require('./npmscripts.config');
const {imports} = npmscriptsConfig.build;
module.exports = {
imports,
// The following symbols override the actual symbols that listed packages export. This is
// sometimes necessary when:
//
// 1. The build cannot infer the exported symbols because the package cannot be required from
// Node.js (eg: if it references `window` or any other browser API not available).
// 2. The inferred exported symbols are wrong (eg: polymorphic packages).
// 3. The package must re-export everything as `default` so that it can be directly imported
// using ES syntax (eg: `react` since it can be imported as `import React from 'react';` even
// though it is a CJS package that doesn't really export any `default` symbol).
//
// For number 3 note that tools like `webpack` sometimes rely on the `__esModule` symbol to
// mimic that behavior. However we prefer to make it explicit in this file due to how much
// headaches the `__esModule` inferences usually cause when they don't work correctly.
//
// The way to obtain these symbols is different for each package but it usually starts with a
// runtime error in the browser and a following investigation on what the package is really
// exporting when used from a browser.
//
symbols: {
'@clayui/charts': ['bb', 'default'],
'@clayui/css': [
// Need to explicitly disable exports because the package differs in browser and server
],
'axe-core': ['*', 'default'],
'clipboard': ['*', 'default'],
'cropperjs': ['*', 'default'],
'dagre': ['*', 'default'],
'fuzzy': ['*', 'default'],
'graphql-hooks-memcache': ['*', 'default'],
'highlight.js': ['*', 'default'],
'highlight.js/lib/core': ['*', 'default'],
'highlight.js/lib/languages/java': ['*', 'default'],
'highlight.js/lib/languages/javascript': ['*', 'default'],
'highlight.js/lib/languages/plaintext': ['*', 'default'],
'image-promise': ['*', 'default'],
'liferay-ckeditor': [],
'lodash.groupby': ['*', 'default'],
'lodash.isequal': ['*', 'default'],
'moment': ['*', 'default'],
'moment/min/moment-with-locales': ['*', 'default'],
'numeral': ['*', 'default'],
'object-hash': ['*', 'default'],
'prop-types': ['*', 'default'],
'qrcode': [
// Need to explicitly list exports because the package differs in browser and server
'create',
'toCanvas',
'toString',
'toDataURL',
],
'qs': ['*', 'default'],
'react': ['*', 'default'],
'react-dnd': ['*', 'default'],
'react-dom': ['*', 'default'],
'text-mask-addons': ['*', 'default'],
'text-mask-core': ['*', 'default'],
},
};