Skip to content

Commit

Permalink
Merge pr/ayjayt/3221 into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkfranz committed Feb 20, 2024
2 parents b3daf3c + 9bd7a73 commit 43f152c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion documentation/md/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The available files are available under [`cytoscape/dist/`](https://github.com/c
| `cytoscape.umd.js` | no | [UMD] | all | Useful for debugging on small pages, supplementary material for an academic paper for example. |
| `cytoscape.esm.min.js` | yes | [ESM] (ECMAScript, uses `import` / `export`) | all | Serves the same purpose as the above, but it can be imported as an [ES6] module without the need for a bundler. |
| `cytoscape.cjs.js` | no | [CJS] (CommonJS, used by [Node.js]) | none | Intended to be consumed automatically by [Node.js] or a bundler like [Webpack] via `require('cytoscape')`. |
| `cytoscape.esm.js` | no | [ESM] (`import` / `export`) | none | Intended to be consumed automatically by [Node.js] or a bundler like [Webpack] via `import cytoscape from 'cytoscape'`. |
| `cytoscape.esm.js` | no | [ESM] (`import` / `export`) | all | Intended to be consumed automatically by [Node.js] or a bundler like [Webpack] via `import cytoscape from 'cytoscape'`. |

<span class="important-indicator"></span> Note that Cytoscape.js uses the dimensions of your HTML DOM element container for layouts and rendering at initialisation. Thus, it is very important to place your CSS stylesheets in the `<head>` before any Cytoscape.js-related code. Otherwise, dimensions may be sporadically reported incorrectly, resulting in undesired behaviour.

Expand Down
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
"node": ">=0.10"
},
"main": "dist/cytoscape.cjs.js",
"module": "dist/cytoscape.esm.js",
"exports": {
".": {
"import": "./dist/cytoscape.esm.js",
"require": "./dist/cytoscape.cjs.js"
}
},
"unpkg": "dist/cytoscape.min.js",
"jsdelivr": "dist/cytoscape.min.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ const configs = [
{
input,
output: { file: 'build/cytoscape.esm.js', format: 'es' },
external: isExternal,
plugins: [
nodeResolve(),
commonjs({ include: '**/node_modules/**' }),
BABEL ? babel(getBabelOptions()) : {},
replace(envVariables),
license(licenseHeaderOptions)
Expand Down

0 comments on commit 43f152c

Please sign in to comment.