Skip to content

Commit

Permalink
Merge pull request #46 from OutpostHQ/treeshake
Browse files Browse the repository at this point in the history
Enhanced Treeshake support
  • Loading branch information
sahilshahane authored Mar 3, 2023
2 parents 5bd71de + e0605f0 commit 1996bb7
Show file tree
Hide file tree
Showing 5 changed files with 1,288 additions and 560 deletions.
27 changes: 18 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,35 @@
"version": "changeset version",
"version:dev": "changeset version --snapshot dev"
},
"dependencies": {
"@jengaui/react": "^0.2.1",
"@testing-library/react": "^14.0.0",
"@types/node": "18.14.4",
"find-up": "6.3.0",
"react-transition-group": "^4.4.5"
},
"devDependencies": {
"@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.26.0",
"@jengaui/react": "0.4.0",
"@size-limit/file": "8.2.4",
"@size-limit/webpack": "8.2.4",
"@size-limit/webpack-why": "8.2.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jest": "29.4.0",
"@types/node": "18.11.3",
"@types/node": "18.14.4",
"eslint": "8.35.0",
"find-up": "6.3.0",
"jest": "29.4.3",
"jest-styled-components": "^7.1.1",
"node-abort-controller": "3.1.1",
"prettier": "^2.8.4",
"react-transition-group": "^4.4.5",
"size-limit": "8.2.4",
"tsup": "6.6.3",
"turbo": "^1.8.3",
"typescript": "~4.7.4"
}
},
"size-limit": [
{
"name": "tasty",
"limit": "100 kb",
"path": "./packages/tastycss/dist/esm/index.js",
"import": "{ tasty }"
}
]
}
10 changes: 8 additions & 2 deletions packages/tastycss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,19 @@
"license": "MIT",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"module": "./dist/esm/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/index.js"
}
},
"files": [
"dist/**"
],
"scripts": {
"build": "tsup src/index.ts --config ./tsup.config.ts",
"build": "tsup --config ./tsup.config.ts",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"dev": "tsup src/index.ts --minify --treeshake --format esm,cjs --watch --dts --external react && yarn size-limit",
"lint": "TIMING=1 eslint src/**/*.ts* --fix",
Expand Down
12 changes: 11 additions & 1 deletion packages/tastycss/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { defineConfig } from 'tsup';

import packageJSON from './package.json';

export default defineConfig({
entry: [
'./src/*.ts',
'./src/tasty.tsx',
'./src/providers/**/*',
'./src/styles/**/*',
'./src/utils/**/*',
],

clean: true,
format: ['cjs', 'esm'],
legacyOutput: true,
treeshake: true,
minify: true,
dts: true,
Expand All @@ -12,4 +22,4 @@ export default defineConfig({
...Object.keys(packageJSON['devDependencies']),
...Object.keys(packageJSON['peerDependencies']),
],
});
});
Loading

0 comments on commit 1996bb7

Please sign in to comment.