Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "type": "module" to package.json (#309)
It ensures that the ESM build of Vite is used instead of the CJS build (deprecated). See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated This is also consistent with the Vite React templates: https://github.com/vitejs/vite/blob/cdc664d4ea98d5373c3ceb2213771f1dfa4bb457/packages/create-vite/template-react-ts/package.json#L5 Because we were using TypeScript to begin with (and therefore the ESM syntax for import/export), no change is required in source files. Note that because ESM ("es") was already the default output format for rollupjs, I don't think there is any difference in the final app (index.html was already using `<script type="module">`). So in essence, this change is really about avoiding the deprecation warning from Vite. .eslintrc.js had to be renamed to .eslintrc.cjs. ESLint currently does not support ESM configuration. Signed-off-by: Antonin Bas <[email protected]>
- Loading branch information