Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce bundle size #209

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

26 changes: 26 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
presets: [
"@babel/preset-typescript",
"@babel/preset-react",
[
"@babel/preset-env",
{
corejs: require('core-js/package.json').version,
useBuiltIns: "usage",
modules: process.env.ESM === "true" ? false : "commonjs"
}
]
],
plugins: [
"babel-plugin-optimize-clsx",
"@babel/plugin-proposal-class-properties",
[
"@babel/plugin-transform-runtime",
{
version: require("@babel/runtime/package.json").version,
useESModules: process.env.ESM === "true"
}
]
],
ignore: ["src/index.d.ts"]
};
6 changes: 6 additions & 0 deletions .browserlistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ie 11
edge >= 14
firefox >= 52
chrome >= 49
safari >= 10
node 8.0
110 changes: 54 additions & 56 deletions package-lock.json

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

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.9.11",
"description": "Highly customizable notification snackbars (toasts) that can be stacked on top of each other",
"main": "build/index.js",
"module": "build/esm/index.js",
"types": "build/index.d.ts",
"license": "MIT",
"author": {
Expand All @@ -17,7 +18,9 @@
},
"scripts": {
"types": "tsc",
"build": "cross-env NODE_ENV=production BABEL_ENV=production babel src -d build --copy-files --extensions \".js,.ts,.tsx\"",
"build-cjs": "cross-env NODE_ENV=production BABEL_ENV=production ESM=false babel src -d build --copy-files --extensions \".js,.ts,.tsx\"",
"build-esm": "cross-env NODE_ENV=production BABEL_ENV=production ESM=true babel src -d build/esm --copy-files --extensions \".js,.ts,.tsx\"",
"build": "npm run build-cjs && npm run build-esm",
"prebuild": "rimraf build && npm run docs",
"prepublishOnly": "npm run build",
"docs": "rimraf typedoc.json && typedoc --tsconfig",
Expand All @@ -32,7 +35,7 @@
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.7",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.9.6",
"@babel/preset-env": "^7.8.7",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
Expand All @@ -45,7 +48,6 @@
"@typescript-eslint/parser": "^2.22.0",
"babel-eslint": "^8.2.6",
"babel-plugin-optimize-clsx": "^2.6.0",
"babel-runtime": "^6.26.0",
"cross-env": "^7.0.2",
"eslint": "^6.1.0",
"eslint-config-airbnb": "~16.1.0",
Expand All @@ -59,7 +61,9 @@
"typescript": "^3.8.3"
},
"dependencies": {
"@babel/runtime": "^7.9.6",
"clsx": "^1.1.0",
"core-js": "^3.6.5",
"hoist-non-react-statics": "^3.3.0",
"react-is": "^16.8.6"
},
Expand Down