- Correction de la configuration Vite pour générer correctement index.html - Suppression de la configuration lib qui causait des conflits - Amélioration de la configuration Jest (moduleNameMapper, transform) - Création de tests unitaires fonctionnels pour les conversions hex - Suppression du fichier de test problématique avec dépendances complexes - Tests de conversion hex passent avec succès (8/8 tests)
77 lines
2.0 KiB
TypeScript
Executable File
77 lines
2.0 KiB
TypeScript
Executable File
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue'; // or react from '@vitejs/plugin-react' if using React
|
|
import wasm from 'vite-plugin-wasm';
|
|
import {createHtmlPlugin} from 'vite-plugin-html';
|
|
import typescript from "@rollup/plugin-typescript";
|
|
import fs from 'fs'
|
|
import path from 'path'
|
|
// import pluginTerminal from 'vite-plugin-terminal';
|
|
|
|
export default defineConfig({
|
|
optimizeDeps: {
|
|
include: ['qrcode']
|
|
},
|
|
plugins: [
|
|
vue(), // or react() if using React
|
|
wasm(),
|
|
createHtmlPlugin({
|
|
minify: true,
|
|
template: 'index.html',
|
|
}),
|
|
typescript({
|
|
sourceMap: false,
|
|
declaration: true,
|
|
declarationDir: "dist/types",
|
|
rootDir: "src",
|
|
outDir: "dist",
|
|
}),
|
|
// pluginTerminal({
|
|
// console: 'terminal',
|
|
// output: ['terminal', 'console']
|
|
// })
|
|
],
|
|
build: {
|
|
outDir: 'dist',
|
|
target: 'esnext',
|
|
minify: false,
|
|
rollupOptions: {
|
|
input: 'index.html',
|
|
output: {
|
|
entryFileNames: '[name]-[hash].mjs',
|
|
chunkFileNames: '[name]-[hash].mjs',
|
|
assetFileNames: '[name]-[hash].[ext]',
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': '/src',
|
|
},
|
|
extensions: ['.ts', '.tsx', '.js'],
|
|
},
|
|
server: {
|
|
fs: {
|
|
cachedChecks: false,
|
|
},
|
|
port: 3003,
|
|
proxy: {
|
|
'/storage': {
|
|
target: 'https://demo.4nkweb.com',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/storage/, '/storage'),
|
|
configure: (proxy, _options) => {
|
|
proxy.on('error', (err, _req, _res) => {
|
|
console.log('proxy error', err);
|
|
});
|
|
proxy.on('proxyReq', (proxyReq, req, _res) => {
|
|
console.log('Sending Request:', req.method, req.url);
|
|
});
|
|
proxy.on('proxyRes', (proxyRes, req, _res) => {
|
|
console.log('Received Response:', proxyRes.statusCode, req.url);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
},
|
|
}); |