-
Notifications
You must be signed in to change notification settings - Fork 86
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
Switch from rollup to vite, from commonjs to ecmascript modules #1740
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1740 +/- ##
==========================================
+ Coverage 97.55% 97.80% +0.25%
==========================================
Files 20 16 -4
Lines 1513 1461 -52
Branches 319 306 -13
==========================================
- Hits 1476 1429 -47
+ Misses 37 32 -5 ☔ View full report in Codecov by Sentry. |
"typings": "./dist/types/index.d.ts", | ||
"types": "./dist/types/index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EXPLAINER: These are no longer required, as exports
below contains the types, and TypeScript primarily looks there.
Pull Request
Related issue
Fixes #1626
Waiting on #1739
What does this PR do?
rollup
tovite
, which internally usesrollup
, but makes things a lot shorter and simplervitest.config.js
scripts/file-size.js
, packageskleur
,pretty-bytes
,brotli-size
,gzip-size
, as it prints sizes by defaultrollup
plugins and dependencies (@rollup/plugin-terser
,@babel/core
,@babel/preset-env
,@rollup/plugin-babel
,@rollup/plugin-commonjs
,@rollup/plugin-json
,@rollup/plugin-node-resolve
,rollup-plugin-typescript2
)shx
package, andcleanup
script, as it clearsdist
itself"type": "module"
).js
project file now needs to be written in ESM syntax, the web standard syntaxtsconfig.json
according to https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html#im-writing-a-librarymodule
tonode16
andverbatimModuleSyntax
totrue
, this requires changes to all TypeScript files so they may be compatible with the web standard ESM.js
extensionindex
directory imports, as that is only a Node.js thing, the web doesn't support ittype
keywordCaution
Old
New
Caution
window
/global
/globalThis
/self
with the exports, instead it extends it with propertymeilisearch
which contains the exportsOld
New
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!