-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshared-libs.mjs
More file actions
40 lines (36 loc) · 1.31 KB
/
shared-libs.mjs
File metadata and controls
40 lines (36 loc) · 1.31 KB
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
// @ts-check
/**
* These are the libraries embedded in the JavaScript Modules engine and shared with JavaScript
* modules on the client.
*
* Declared as `name: path` pairs, where the name is the import specifier and the path is the path
* to the file. Bare import specifiers are resolved as `node_modules` paths.
*
* @type {Record<string, string>}
*/
export const clientLibs = {
// React ships as CJS, so we need our own shims
// See src/esm-shims/README.md for details
"react": "./src/shared/react.ts",
"react/jsx-runtime": "./src/shared/react/jsx-runtime.ts",
"react-dom": "./src/shared/react-dom.ts",
"react-dom/client": "./src/shared/react-dom/client.ts",
// Packages already in ESM can be copied as-is from node_modules
"i18next": "i18next",
"react-i18next": "react-i18next",
};
/**
* Same as {@link clientLibs}, but for server libraries.
*
* @type {Record<string, string>}
*/
export const serverLibs = {
"react": "./src/shared/react.ts",
"react/jsx-runtime": "./src/shared/react/jsx-runtime.ts",
"react-dom": "./src/shared/react-dom.ts",
// Packages already in ESM can be copied as-is from node_modules
"i18next": "i18next",
"react-i18next": "react-i18next",
// The JSM library is exclusive to the server
"@jahia/javascript-modules-library": "@jahia/javascript-modules-library",
};