From d82841119820b4814169a8fa42a88f166f406a6f Mon Sep 17 00:00:00 2001 From: Michal Wolny Date: Tue, 6 Oct 2020 19:28:20 +0200 Subject: [dev-icons-react-bundling] change svgr template to enable babel transformation, add babel with react and env, add rollup for commonJS, UMD and ESM, add gulp and npm tasks for building react, add peer react and react-dom dependencies, add needed deps, updated npm package files, updated readme --- package.json | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'package.json') diff --git a/package.json b/package.json index a0c401d0..bf553902 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "type": "git", "url": "git+https://github.com/tabler/tabler-icons.git" }, - "main": "./icons-react/index.js", - "module": "./icons-react/index.js", + "main": "./icons-react/dist/index.cjs.js", + "module": "./icons-react/dist/index.esm.js", + "browser": "./icons-react/dist/index.umd.js", "types": "./icons-react/index.d.ts", "author": "", "license": "MIT", @@ -20,7 +21,8 @@ "files": [ "icons/*", "icons-png/*", - "icons-react/*", + "icons-react/index.d.ts", + "icons-react/dist/*", "iconfont/*", "tabler-sprite.svg", "tabler-sprite-nostroke.svg" @@ -28,13 +30,22 @@ "homepage": "https://github.com/tabler/tabler-icons#readme", "scripts": { "start": "bundle exec jekyll serve --watch --livereload --trace --livereload_port 8888", + "prebuild-react": "rm -rf ./icons-react/dist/", + "build-react": "rollup -c", "optimize": "gulp optimize", "release": "release-it" }, "description": "", "devDependencies": { - "@svgr/core": "5.4.0", + "@babel/core": "7.11.6", + "@babel/parser": "7.11.5", + "@babel/preset-env": "7.11.5", + "@babel/preset-react": "7.10.4", + "@rollup/plugin-babel": "5.2.1", + "@rollup/plugin-commonjs": "15.1.0", + "@rollup/plugin-node-resolve": "9.0.0", "@svgr/babel-plugin-replace-jsx-attribute-value": "5.0.1", + "@svgr/core": "5.4.0", "clean-css": "4.2.3", "glob": "7.1.6", "gulp": "4.0.2", @@ -45,6 +56,11 @@ "node-sass": "4.14.1", "puppeteer": "5.3.0", "release-it": "14.0.3", + "rollup": "2.28.2", + "rollup-plugin-filesize": "9.0.2", + "rollup-plugin-peer-deps-external": "2.2.3", + "rollup-plugin-terser": "7.0.2", + "rollup-plugin-uglify": "6.0.4", "svg-outline-stroke": "1.3.0" }, "release-it": { @@ -62,5 +78,9 @@ "github": { "release": true } + }, + "peerDependencies": { + "react": "^16.13.1", + "react-dom": "^16.13.1" } } -- cgit v1.2.1