[U] Migrate from vue-cli to vite
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
@@ -8,14 +8,14 @@
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
|
||||
<title>Home</title>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" integrity="sha512-uto9mlQzrs59VwILcLiRYeLKPPbS/bT71da/OEBYEwcdNUk8jYIy+D176RYoop1Da+f9mvkYrmj5MCLZWEtQuA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without
|
||||
JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
|
||||
<style>
|
||||
+12
-18
@@ -3,21 +3,17 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
"serve": "vite",
|
||||
"build": "vue-tsc --noEmit && yarn lint && vite build",
|
||||
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src"
|
||||
},
|
||||
"dependencies": {
|
||||
"vite": "^2.8.6",
|
||||
"@vitejs/plugin-vue": "^2.2.4",
|
||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||
"@types/jquery": "^3.5.11",
|
||||
"@types/jqueryui": "^1.12.16",
|
||||
"@types/marked": "^4.0.1",
|
||||
"@types/three": "^0.135.0",
|
||||
"animsition": "^4.0.2",
|
||||
"core-js": "^3.6.5",
|
||||
"emoji-regex": "^10.0.0",
|
||||
"jquery": "^3.6.0",
|
||||
"jqueryui": "^1.11.1",
|
||||
"linkify-urls": "^4.0.0",
|
||||
"marked": "^4.0.6",
|
||||
"meshline": "^2.0.3",
|
||||
@@ -26,24 +22,22 @@
|
||||
"vue": "^3.0.0",
|
||||
"vue-class-component": "^8.0.0-rc.1",
|
||||
"vue-i18n": "^9.2.0-beta.23",
|
||||
"vue-property-decorator": "^9.1.2",
|
||||
"vue-property-decorator": "^10.0.0-rc.3",
|
||||
"vue-router": "^4.0.0-0",
|
||||
"vue3-colorpicker": "^2.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jquery": "^3.5.11",
|
||||
"@types/jqueryui": "^1.12.16",
|
||||
"@types/marked": "^4.0.1",
|
||||
"@types/three": "^0.135.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.18.0",
|
||||
"@typescript-eslint/parser": "^4.18.0",
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-plugin-typescript": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0",
|
||||
"sass": "^1.26.5",
|
||||
"sass-loader": "^8.0.2",
|
||||
"typescript": "~4.1.5"
|
||||
"typescript": "^4.6.2",
|
||||
"vue-tsc": "^0.32.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ const routes: Array<RouteRecordRaw> = [
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (about.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
|
||||
component: () => import('../views/About.vue')
|
||||
},
|
||||
{
|
||||
path: '/life',
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
/* eslint-disable */
|
||||
declare module '*.vue'
|
||||
{
|
||||
|
||||
+1
-4
@@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"strict": true,
|
||||
"strict": false,
|
||||
"jsx": "preserve",
|
||||
"importHelpers": true,
|
||||
"moduleResolution": "node",
|
||||
@@ -12,9 +12,6 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import path from "path";
|
||||
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
|
||||
import tsconfig from "./tsconfig.json";
|
||||
|
||||
const tsconfigPathAliases = Object.fromEntries(
|
||||
Object.entries(tsconfig.compilerOptions.paths).map(([key, values]) => {
|
||||
let value = values[0];
|
||||
if (key.endsWith("/*")) {
|
||||
key = key.slice(0, -2);
|
||||
value = value.slice(0, -2);
|
||||
}
|
||||
|
||||
const nodeModulesPrefix = "node_modules/";
|
||||
if (value.startsWith(nodeModulesPrefix)) {
|
||||
value = value.replace(nodeModulesPrefix, "");
|
||||
} else {
|
||||
value = path.join(__dirname, value);
|
||||
}
|
||||
|
||||
return [key, value];
|
||||
})
|
||||
);
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue()
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
...tsconfigPathAliases,
|
||||
vue: "vue/dist/vue.esm-bundler.js"
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
runtimeCompiler: true,
|
||||
devServer: {
|
||||
disableHostCheck: true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user