Skip to content

Commit

Permalink
Move Vite code to MJS
Browse files Browse the repository at this point in the history
Per this notice: https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated

For TypeScript, that means `MTS` as the extension.
  • Loading branch information
stefcameron committed Mar 6, 2024
1 parent 92ef026 commit b3be865
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
"npm": "10"
},
"scripts": {
"build": "tsc && vite build --emptyOutDir --config config/vite.config.ts && npm run build:dts && cp ./dist/canvas-txt.esm.min.js ./dist/canvas-txt.mjs",
"build:docs": "tsc && vite build --config config/vite.config.docs.ts",
"build": "tsc && vite build --emptyOutDir --config config/vite.config.mts && npm run build:dts && cp ./dist/canvas-txt.esm.min.js ./dist/canvas-txt.mjs",
"build:docs": "tsc && vite build --config config/vite.config.docs.mts",
"build:dts": "tsup src/canvas-txt/index.ts --dts-only && mv dist/index.d.ts dist/canvas-txt.d.ts",
"prepare": "npm run build",
"start": "vite serve --config config/vite.config.docs.ts",
"start": "vite serve --config config/vite.config.docs.mts",
"test": "npm run test:unit && npm run build",
"test:unit": "vite-node ./src/node-test.ts"
},
Expand Down
6 changes: 5 additions & 1 deletion src/auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Generated by 'unplugin-auto-import'
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {

Expand Down
10 changes: 5 additions & 5 deletions src/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

declare module '@vue/runtime-core' {
declare module 'vue' {
export interface GlobalComponents {
ElButton: typeof import('element-plus/es')['ElButton']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
Expand Down

0 comments on commit b3be865

Please sign in to comment.