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

Improve build process #46

Merged
merged 13 commits into from
Jan 25, 2023
Merged

Improve build process #46

merged 13 commits into from
Jan 25, 2023

Conversation

kytta
Copy link
Owner

@kytta kytta commented Jan 25, 2023

Somewhat breaking changes

  • Disable sourcemaps on the output
    • I don't know whether anyone depends on it, though
  • Minify with esbuild instead of terser
    • This also disables the minification of ESM, which is a good thing, because otherwise the file can't be tree-shaken properly

Other changes

  • Make project type module
    • AFAIA, this doesn't really change anything other than the runner used for the config files, etc.
  • Remove banner
    • It took unnecessary bytes, and embedding it with esbuild/vite is somewhat buggy
  • Update to Vite v4
  • Build CSS using Vite
    • this makes the build script leaner
  • Remove Browserslist config to always target the defaults
    • the previous config (using last 3 versions instead of last 2 versions) didn't change coverage that much
  • Fix code style
  • Move PostCSS config to package.json
  • Move ESLint config to package.json

Left to do

  • release the rc version as @next
  • test every use case
    • browser import via ESM
    • browser import via IIFE
    • browser import via UMD
    • Node import via ESM
    • Node import via UMD

@kytta kytta self-assigned this Jan 25, 2023
@kytta
Copy link
Owner Author

kytta commented Jan 25, 2023

v2.0.2-0 is out, let's test...

@kytta kytta marked this pull request as ready for review January 25, 2023 18:54
@kytta kytta force-pushed the leaner-build branch 2 times, most recently from 67dbd67 to b5b3da6 Compare January 25, 2023 19:11
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/shareon.min.css 5.43 KB (added)
./dist/shareon.es.js 837 B (added)

@kytta kytta merged commit bacd69c into main Jan 25, 2023
@kytta kytta deleted the leaner-build branch January 25, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant