{
"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,
-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 = []
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`
}
},
{
from: /^\/@.*$/,
to({ parsedUrl }) {
+ // console.log('bypassing', parsedUrl.pathname, parsedUrl.href)
return parsedUrl.href
},
},
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==
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==