From f1995232bb5d1514f747cb354a38275a59281e5f Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 11 Nov 2021 17:29:47 -0500 Subject: [PATCH] Migrate to Vue 3 and vite --- babel.config.json | 11 ----- index.html | 11 +++++ package.json | 28 +++++------ src/App.vue | 123 ++++++++++++++++++++++------------------------ src/index.html | 4 -- src/index.ts | 17 ++----- tsconfig.json | 16 ++++-- vite.config.ts | 13 +++++ 8 files changed, 109 insertions(+), 114 deletions(-) delete mode 100644 babel.config.json create mode 100644 index.html delete mode 100644 src/index.html create mode 100644 vite.config.ts diff --git a/babel.config.json b/babel.config.json deleted file mode 100644 index 6425b3c..0000000 --- a/babel.config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugins": ["@babel/plugin-transform-runtime"], - "presets": [ - [ - "@babel/preset-env", - { - "useBuiltIns": "usage" - } - ] - ] -} diff --git a/index.html b/index.html new file mode 100644 index 0000000..d620beb --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + + Tool Reservations + + +
+ + + diff --git a/package.json b/package.json index ad557ca..e27809b 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,26 @@ { - "browserslist": [ - "defaults", - "ios 9.3" - ], "scripts": { - "start": "parcel src/index.html" + "start": "npm run dev", + "dev": "vite", + "build": "vue-tsc --noEmit && vite build", + "serve": "vite preview" }, "devDependencies": { - "@babel/core": "^7.8.7", - "@babel/plugin-transform-runtime": "^7.8.3", - "@babel/preset-env": "^7.8.7", - "@vue/component-compiler-utils": "^3.0.0", + "@types/intl": "^1.2.0", + "@vitejs/plugin-legacy": "^1.6.2", + "@vitejs/plugin-vue": "^1.9.4", "sass": "^1.23.1", "typescript": "^4.2.3", - "vue-template-compiler": "^2.6.10" + "vite": "^2.6.13", + "vue-tsc": "^0.28.10" }, "dependencies": { - "@fullcalendar/core": "^5.6.0", + "@fullcalendar/core": "^5.10.0", "@fullcalendar/google-calendar": "^5.6.0", "@fullcalendar/timegrid": "^5.6.0", - "@fullcalendar/vue": "^5.6.0", - "core-js": "^3.6.4", + "@fullcalendar/vue3": "^5.10.0", "equicolor": "^1.1.0", "intl": "^1.2.5", - "vue": "^2.6.10", - "vue-hot-reload-api": "^2.3.4", - "vue-property-decorator": "^9.1.2" + "vue": "^3.2.20" } } diff --git a/src/App.vue b/src/App.vue index f787dd7..60bf107 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,18 +2,20 @@ - diff --git a/src/index.html b/src/index.html deleted file mode 100644 index a0434ae..0000000 --- a/src/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -
- - diff --git a/src/index.ts b/src/index.ts index 173cb05..4f612eb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,18 +1,7 @@ import 'core-js/modules/es.object.entries'; -// TODO: could probably be a dynamic import -import intl from 'intl'; -import 'intl/locale-data/jsonp/en.js'; +import * as Vue from 'vue'; -if (!window.Intl) { - // No `Intl`, so use and load the polyfill. - window.Intl = intl; -} +import App from './App.vue'; -import Vue from 'vue'; - -import App from './App'; - -let app = new Vue({ - render: (h) => h(App), -}).$mount('#app'); +const app = Vue.createApp(App).mount('#app'); diff --git a/tsconfig.json b/tsconfig.json index 06e399d..8617c8a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,9 +1,15 @@ { "compilerOptions": { - "target": "es5", - "strict": true, - "module": "es2015", + "target": "esnext", + "useDefineForClassFields": true, + "module": "esnext", "moduleResolution": "node", - "resolveJsonModule": true - } + "strict": true, + "jsx": "preserve", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "lib": ["esnext", "dom"] + }, + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] } diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..92491e8 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vite'; +import vue from '@vitejs/plugin-vue'; +import legacy from '@vitejs/plugin-legacy' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + legacy({ + targets: ['defaults', 'not IE 11', "ios 8.4"] + }), + ], +});