Skip to content

Commit

Permalink
Improve tree shaking support
Browse files Browse the repository at this point in the history
  • Loading branch information
halilatilla committed Aug 26, 2024
1 parent 2f4eb43 commit 12b649c
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 7 deletions.
7 changes: 6 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ interface SVGRProps {
titleId?: string;
}
declare const Memo: React.MemoExoticComponent<({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => JSX.Element>;
export { Memo as IconAdmin };
interface SVGRProps$0 {
title?: string;
titleId?: string;
}
declare const Memo$0: React.MemoExoticComponent<({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps$0) => JSX.Element>;
export { Memo as IconAdminCopy, Memo$0 as IconAdmin };
14 changes: 14 additions & 0 deletions dist/index.esm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/// <reference types="react" />
import * as React from "react";
import { SVGProps } from "react";
interface SVGRProps {
title?: string;
titleId?: string;
}
declare const Memo: React.MemoExoticComponent<({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => JSX.Element>;
interface SVGRProps$0 {
title?: string;
titleId?: string;
}
declare const Memo$0: React.MemoExoticComponent<({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps$0) => JSX.Element>;
export { Memo as IconAdminCopy, Memo$0 as IconAdmin };
1 change: 1 addition & 0 deletions dist/index.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions icons/admin-copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"Github actions"
],
"main": "dist/index.js",
"module": "dist/index.esm.js",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.js"
}
},
"sideEffects": false,
"files": [
"dist"
],
Expand Down
14 changes: 10 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ import ts from 'rollup-plugin-ts';

const config = {
input: 'src/index.tsx',
output: {
file: 'dist/index.js',
format: 'cjs',
},
output: [
{
file: 'dist/index.js',
format: 'cjs',
},
{
file: 'dist/index.esm.js',
format: 'es',
},
],
external: [/@babel\/runtime/, 'react'],
plugins: [
babel({ babelHelpers: 'runtime', plugins: ['@babel/plugin-transform-runtime'] }),
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"rootDir": "src",
"skipLibCheck": true,
"sourceMap": true,
"target": "es5"
"target": "es2015"
},
"include": ["src/**/*", "index.ts"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit 12b649c

Please sign in to comment.