Skip to content

Commit 36b71cf

Browse files
committed
Replace Webpack with Microbundle
1 parent eadd959 commit 36b71cf

File tree

8 files changed

+21
-87
lines changed

8 files changed

+21
-87
lines changed

.babelrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
/*.tgz
2+
dist
13
node_modules
2-
dist

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.idea
12
node_modules

demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script src="node_modules/react-dom/umd/react-dom.development.js"></script>
99
<script src="node_modules/cytoscape/dist/cytoscape.min.js"></script>
1010
<script src="node_modules/prop-types/prop-types.js"></script>
11-
<script src="dist/react-cytoscape.js"></script>
11+
<script src="dist/react-cytoscape.umd.js"></script>
1212

1313
<title>react-cytoscapejs demo</title>
1414

package.json

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,50 @@
1010
"bugs": {
1111
"url": "https://github.com/plotly/react-cytoscapejs/issues"
1212
},
13+
"amdName": "ReactCytoscape",
14+
"exports": "./dist/react-cytoscape.modern.js",
15+
"main": "dist/react-cytoscape.cjs.js",
16+
"module": "dist/react-cytoscape.module.js",
17+
"source": "src/index.js",
18+
"umd:main": "dist/react-cytoscape.umd.js",
19+
"unpkg": "dist/react-cytoscape.umd.js",
1320
"homepage": "https://github.com/plotly/react-cytoscapejs",
14-
"main": "./dist/react-cytoscape.js",
1521
"scripts": {
16-
"prepare": "run-s build:prod build:docgen",
17-
"bundle": "webpack",
18-
"build:dev": "cross-env NODE_ENV=development run-s bundle",
19-
"build:prod": "cross-env NODE_ENV=production run-s bundle",
22+
"prepare": "run-s build build:docgen",
23+
"build": "microbundle --globals=react=React,cytoscape=cytoscape,prop-types=PropTypes",
2024
"build:docgen": "react-docgen src/component.js --pretty -o dist/react-cytoscape.docgen.json",
2125
"clean": "rimraf dist/*",
2226
"test:eslint": "eslint src/**",
2327
"test:eslint:fix": "eslint --fix src/**",
2428
"test:prettier": "prettier --list-different src/**",
2529
"test:prettier:fix": "prettier --write src/**",
26-
"test:mocha": "run-s bundle test:mocha:run",
30+
"test:mocha": "run-s build test:mocha:run",
2731
"test:mocha:run": "mocha-chrome test/index.html",
2832
"test": "run-s test:*",
29-
"watch": "cross-env NODE_ENV=development webpack --watch --config webpack.config.js",
30-
"start": "run-s watch",
31-
"demo": "cross-env NODE_ENV=development webpack-serve webpack.config.js --open --open-path demo.html"
33+
"watch": "microbundle watch --globals=react=React,cytoscape=cytoscape,prop-types=PropTypes",
34+
"start": "run-s watch"
3235
},
3336
"peerDependencies": {
3437
"react": ">=15.0.0"
3538
},
3639
"devDependencies": {
37-
"babel-core": "^6.26.0",
38-
"babel-loader": "^7.1.2",
39-
"babel-polyfill": "^6.9.1",
40-
"babel-preset-env": "^1.6.0",
41-
"babel-preset-react": "^6.24.1",
4240
"chai": "^4.1.2",
43-
"cross-env": "^5.0.0",
4441
"eslint": "^4.6.1",
4542
"eslint-config-standard": "^10.2.1",
4643
"eslint-plugin-import": "^2.7.0",
4744
"eslint-plugin-node": "^5.1.1",
4845
"eslint-plugin-promise": "^3.5.0",
4946
"eslint-plugin-standard": "^3.0.1",
5047
"immutable": "^3.8.2",
48+
"microbundle": "^0.15.0",
5149
"mocha": "^5.2.0",
5250
"mocha-chrome": "^1.1.0",
5351
"npm-run-all": "^4.1.1",
5452
"prettier": "^1.13.7",
5553
"react": "^16.4.1",
5654
"react-docgen": "^2.21.0",
5755
"react-dom": "^16.4.1",
58-
"rimraf": "^2.6.2",
59-
"webpack": "^4.15.1",
60-
"webpack-cli": "^3.0.8",
61-
"webpack-dev-server": "^3.9.0",
62-
"webpack-serve": "^1.0.4"
56+
"rimraf": "^2.6.2"
6357
},
6458
"engines": {
6559
"node": ">=8.11.3"

src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
module.exports = require('./component').default;
1+
import Component from './component';
2+
export default Component;

test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<script src="../node_modules/cytoscape/dist/cytoscape.min.js"></script>
1414
<script src="../node_modules/immutable/dist/immutable.js"></script>
1515
<script src="../node_modules/prop-types/prop-types.js"></script>
16-
<script src="../dist/react-cytoscape.js"></script>
16+
<script src="../dist/react-cytoscape.umd.js"></script>
1717
</head>
1818

1919
<body>

webpack.config.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)