migrate to vite instead of webpack

This commit is contained in:
2023-07-04 18:11:20 +02:00
parent 7d379bbe62
commit 3b8bec2f6c
7 changed files with 548 additions and 16685 deletions

View File

@@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
};

View File

@@ -6,9 +6,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="/favicon.ico">
<title> <title>
<%= htmlWebpackPlugin.options.title %> libreevent
</title> </title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200">
<script defer src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script defer src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
@@ -18,11 +18,11 @@
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. <strong>We're sorry but this app doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong> Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>

View File

@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es6",
"module": "esnext", "module": "esnext",
"baseUrl": "./", "baseUrl": "./",
"moduleResolution": "node", "moduleResolution": "node",

File diff suppressed because it is too large Load Diff

View File

@@ -3,21 +3,20 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vite",
"build": "vue-cli-service build" "preview": "vite preview",
"build": "vite build"
}, },
"dependencies": { "dependencies": {
"@pdfme/generator": "^1.2.3", "@pdfme/generator": "^1.2.3",
"@pdfme/ui": "^1.2.3", "@pdfme/ui": "^1.2.3",
"core-js": "^3.8.3",
"pinia": "^2.0.34", "pinia": "^2.0.34",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vue3-draggable-resizable": "^1.6.5" "vue3-draggable-resizable": "^1.6.5"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0", "@vitejs/plugin-vue": "^1.10.2",
"@vue/cli-plugin-router": "~5.0.0", "vite": "^2.5.4"
"@vue/cli-service": "~5.0.0"
} }
} }

View File

@@ -23,7 +23,7 @@ const routes = mainRoutes;
routes.push( adminRoutes ); routes.push( adminRoutes );
const router = createRouter( { const router = createRouter( {
history: createWebHistory( process.env.BASE_URL ), history: createWebHistory( import.meta.env.BASE_URL ),
routes, routes,
} ); } );

12
src/webapp/vite.config.js Normal file
View File

@@ -0,0 +1,12 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require( 'path' );
export default defineConfig( {
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve( __dirname, './src' ),
},
},
} );