From 8aa0843837857082f197e7ba9841368f8a816ad4 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 5 Aug 2021 12:30:10 +0200 Subject: [PATCH] test: rever vite upgrade --- e2e/tsconfig.json | 2 +- e2e/vite.config.js | 19 +++++++++++++------ package.json | 2 +- yarn.lock | 16 ++-------------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index 12c9a842..d61bd724 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -1,7 +1,7 @@ { "include": ["index.ts", "*/*.ts", "../src/global.d.ts"], "compilerOptions": { - "target": "es5", + "target": "es6", "module": "commonjs", // "lib": ["es2017.object"] /* Specify library files to be included in the compilation. */, "declaration": true, diff --git a/e2e/vite.config.js b/e2e/vite.config.js index 5046a32a..d6e47bff 100644 --- a/e2e/vite.config.js +++ b/e2e/vite.config.js @@ -1,8 +1,8 @@ -const fs = require('fs') -const { resolve, join } = require('path') -const { defineConfig } = require('vite') -const vue = require('@vitejs/plugin-vue') -const history = require('connect-history-api-fallback') +import fs from 'fs' +import { resolve, join } from 'path' +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import history from 'connect-history-api-fallback' /** @type {string[]} */ let examples = [] @@ -54,9 +54,15 @@ const config = (env = {}) => { from: new RegExp(`^/${name}/.*$`), to({ parsedUrl }) { // console.log('checking for', parsedUrl.pathname) - if (fs.existsSync(join(__dirname, parsedUrl.pathname))) { + const filePath = join(__dirname, parsedUrl.pathname) + if ( + fs.existsSync(filePath) && + !fs.statSync(filePath).isDirectory() + ) { + // console.log('\t', parsedUrl.pathname) return parsedUrl.pathname } else { + // console.log('\t', `/${name}/index.html`) return `/${name}/index.html` } }, @@ -65,6 +71,7 @@ const config = (env = {}) => { { from: /^\/@.*$/, to({ parsedUrl }) { + // console.log('bypassing', parsedUrl.pathname, parsedUrl.href) return parsedUrl.href }, }, diff --git a/package.json b/package.json index eb8934a7..c0666770 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "selenium-server": "^3.141.59", "serve-handler": "^6.1.3", "typescript": "^4.3.5", - "vite": "^2.3.1", + "vite": "~2.3.1", "vitepress": "^0.14.1", "vue": "^3.1.0", "vue-tsc": "^0.2.2", diff --git a/yarn.lock b/yarn.lock index 380df7d1..6f891f01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6460,7 +6460,7 @@ postcss-value-parser@^4.1.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb" integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ== -postcss@^8.1.10, postcss@^8.2.15, postcss@^8.3.4, postcss@^8.3.6: +postcss@^8.1.10, postcss@^8.2.15, postcss@^8.3.4: version "8.3.6" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.6.tgz#2730dd76a97969f37f53b9a6096197be311cc4ea" integrity sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A== @@ -8220,19 +8220,7 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.3.1: - version "2.4.4" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.4.4.tgz#8c402a07ad45f168f6eb5428bead38f3e4363e47" - integrity sha512-m1wK6pFJKmaYA6AeZIUXyiAgUAAJzVXhIMYCdZUpCaFMGps0v0IlNJtbmPvkUhVEyautalajmnW5X6NboUPsnw== - dependencies: - esbuild "^0.12.8" - postcss "^8.3.6" - resolve "^1.20.0" - rollup "^2.38.5" - optionalDependencies: - fsevents "~2.3.2" - -vite@^2.3.7: +vite@^2.3.7, vite@~2.3.1: version "2.3.8" resolved "https://registry.yarnpkg.com/vite/-/vite-2.3.8.tgz#42e3e03953859fd410e4e6ab3d1cca0aab2adc3c" integrity sha512-QiEx+iqNnJntSgSF2fWRQvRey9pORIrtNJzNyBJXwc+BdzWs83FQolX84cTBo393cfhObrtWa6180dAa4NLDiQ== -- 2.47.2