diff options
author | codecalm <codecalm@gmail.com> | 2022-07-09 17:03:12 +0200 |
---|---|---|
committer | codecalm <codecalm@gmail.com> | 2022-07-09 17:03:12 +0200 |
commit | 036d995c77bd8f4df746bd10efb5a0ac45409231 (patch) | |
tree | 733bd5675b14a454cc28735b0afe2cbbd2640a1b /packages/icons-react | |
parent | Release 1.72.0 (diff) | |
download | tabler-icons-dev-react.tar.xz |
new build processdev-react
Diffstat (limited to 'packages/icons-react')
-rw-r--r-- | packages/icons-react/.gitignore | 1 | ||||
-rw-r--r-- | packages/icons-react/readme.md | 3 | ||||
-rw-r--r-- | packages/icons-react/rollup.config.js | 119 |
3 files changed, 123 insertions, 0 deletions
diff --git a/packages/icons-react/.gitignore b/packages/icons-react/.gitignore new file mode 100644 index 00000000..71bcfc6c --- /dev/null +++ b/packages/icons-react/.gitignore @@ -0,0 +1 @@ +src/* diff --git a/packages/icons-react/readme.md b/packages/icons-react/readme.md new file mode 100644 index 00000000..3bd0e60b --- /dev/null +++ b/packages/icons-react/readme.md @@ -0,0 +1,3 @@ +# Tabler Icons React + +Implementation of the Tabler Icons library for React applications. diff --git a/packages/icons-react/rollup.config.js b/packages/icons-react/rollup.config.js new file mode 100644 index 00000000..3e733de5 --- /dev/null +++ b/packages/icons-react/rollup.config.js @@ -0,0 +1,119 @@ +import resolve from "@rollup/plugin-node-resolve"; +import commonjs from "@rollup/plugin-commonjs"; +import filesize from "rollup-plugin-filesize"; +import babel from "@rollup/plugin-babel"; +import external from "rollup-plugin-peer-deps-external"; +import { terser } from "rollup-plugin-terser"; +import { uglify } from "rollup-plugin-uglify"; +import pkg from "./../../package.json"; + +const input = "icons-react/index.js"; + +const minifyExtension = (pathToFile) => pathToFile.replace(/\.js$/, ".min.js"); + +const plugins = [ + babel({ + exclude: "node_modules/**", + }), + external(), + resolve(), + commonjs(), + filesize(), +]; + +const minCjsPlugins = [ + babel({ + exclude: "node_modules/**", + }), + external(), + resolve(), + commonjs(), + uglify(), + filesize(), +]; + +const minUmdEsmPlugins = [ + babel({ + exclude: "node_modules/**", + }), + external(), + resolve(), + commonjs(), + terser(), + filesize(), +]; + +export default [ + // CommonJS (for Node) + { + input, + output: { + file: pkg.main, + format: "cjs", + sourcemap: true, + }, + plugins, + }, + // CommonJS (for Node) minified + { + input, + output: { + file: minifyExtension(pkg.main), + format: "cjs", + sourcemap: true, + }, + plugins: minCjsPlugins, + }, + // UMD (for browser) + { + input, + output: { + file: pkg['umd:main'], + format: "umd", + sourcemap: true, + name: "tablerIcons", + globals: { + react: "React", + "react-dom": "ReactDOM", + }, + }, + plugins, + }, + // UMD (for browser) minified + { + input, + output: { + file: minifyExtension(pkg['umd:main']), + format: "umd", + sourcemap: true, + name: "tablerIcons", + globals: { + react: "React", + "react-dom": "ReactDOM", + }, + }, + plugins: minUmdEsmPlugins, + }, + // ESM (for bundlers) + { + input, + output: { + file: pkg.module, + format: "es", + sourcemap: true, + exports: "named", + }, + plugins, + }, + // ESM (for bundlers) minified + { + input, + output: { + file: minifyExtension(pkg.module), + format: "es", + sourcemap: true, + exports: "named", + }, + plugins: minUmdEsmPlugins, + }, +]; |