Skip to content

Commit db11116

Browse files
author
Nir Maoz
authored
Refactor build to use microbundle instead of webpack (#215)
1 parent 564dca1 commit db11116

File tree

4 files changed

+12
-238
lines changed

4 files changed

+12
-238
lines changed

bundlewatch.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const bundlewatchConfig = {
22
files: [
33
{
44
path: './dist/cloudinary-react.js',
5-
maxSize: '44.5kb'
5+
maxSize: '8kb'
66
}
77
],
88
defaultCompression: 'gzip',

package.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
"name": "cloudinary-react",
33
"version": "1.6.8",
44
"description": "Present Cloudinary images and videos using React components",
5-
"main": "lib/index.js",
5+
"main": "./dist/cloudinary-react.js",
6+
"umd:main": "./dist/cloudinary-react.umd.js",
7+
"module": "dist/cloudinary-react.esm.js",
8+
"source": "src/index.js",
9+
"engines": {
10+
"node": ">=10"
11+
},
612
"scripts": {
713
"test": "run-s build test:unit test:build test:e2e",
814
"test:unit": "jest",
915
"test:build": "TEST_ENV=PRODUCTION npm run test:unit",
1016
"test:e2e": "cd ./e2e-test && npm run test",
1117
"test:coverage": "jest --coverage",
1218
"pretest:e2e": "npm pack && cpy cloudinary-react-*.tgz e2e-test --rename=cloudinary-react.tgz",
13-
"prebuild": "node_modules/.bin/babel src --out-dir lib --copy-files ",
14-
"build": "node_modules/.bin/webpack && npm run bundlewatch",
19+
"build": "microbundle --no-compress --sourcemap false --jsx React.createElement --format esm,umd,cjs && npm run bundlewatch",
20+
"start": "microbundle watch --no-compress --sourcemap false --jsx React.createElement --format esm,umd,cjs",
1521
"bundlewatch": "bundlewatch --config ./bundlewatch.config.js",
1622
"storybook": "start-storybook -p 6006",
1723
"build-storybook": "del-cli docs && build-storybook -c .storybook -o docs",
@@ -53,11 +59,10 @@
5359
"jest-enzyme": "^7.1.2",
5460
"jest-extended": "^0.11.5",
5561
"jsdom": "^11.12.0",
62+
"microbundle": "^0.13.0",
5663
"npm-run-all": "^4.1.5",
5764
"react": "^16.3.3",
58-
"react-dom": "^16.3.3",
59-
"webpack": "4.27.1",
60-
"webpack-cli": "^3.1.2"
65+
"react-dom": "^16.3.3"
6166
},
6267
"dependencies": {
6368
"cloudinary-core": "^2.11.3",
@@ -67,8 +72,6 @@
6772
"react": "^16.3.3 || ^17.0.0"
6873
},
6974
"files": [
70-
"src",
71-
"lib",
7275
"dist"
7376
]
7477
}

tools/update_version

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

webpack.config.js

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

0 commit comments

Comments
 (0)