Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leaysgur/vite-mpa-tailwind-css-bundle-size
https://github.com/leaysgur/vite-mpa-tailwind-css-bundle-size
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/leaysgur/vite-mpa-tailwind-css-bundle-size
- Owner: leaysgur
- Created: 2021-08-20T12:05:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-21T11:47:45.000Z (about 3 years ago)
- Last Synced: 2024-04-15T07:12:06.713Z (7 months ago)
- Language: JavaScript
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vite-mpa-tailwind-css-bundle-size
```
$ npm run build> [email protected] build
> vite buildvite v2.5.0 building for production...
transforming (17) node_modules/react/cjs/react.production.min.js
warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
✓ 29 modules transformed.
dist/app1/index.html 0.45 KiB
dist/app2/index.html 0.45 KiB
dist/assets/modulepreload-polyfill.b7f2da20.js 0.69 KiB / brotli: 0.32 KiB
dist/assets/app2.de9c9aef.js 0.84 KiB / brotli: 0.38 KiB
dist/assets/app1.1540d493.js 3.51 KiB / brotli: 1.08 KiB
dist/assets/app2.74ba676f.css 8.40 KiB / brotli: 2.14 KiB
dist/assets/app1.e7a3cdc9.css 8.40 KiB / brotli: 2.13 KiB
dist/assets/vendor.3d9c5d49.js 127.59 KiB / brotli: 36.08 KiB
```As shown above, `app1.css` and `app2.css` have the same size.
Even though `app2` only have a few class usage...😢
As a work-around, you need to overwrite bundled assets by Vite like this to optimize.
```
NODE_ENV=production ./node_modules/.bin/tailwindcss -i ./app2/style.css -o ./dist/assets/app2.74ba676f.css --minify --purge ./app2/**/*.jsx
```