build: import babel

This commit is contained in:
dongchengjie 2024-05-28 09:59:41 +08:00
parent 03e2632294
commit 60fee2accb
4 changed files with 2236 additions and 545 deletions

7
.babelrc Normal file
View File

@ -0,0 +1,7 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
]
}

View File

@ -38,7 +38,6 @@
"meta-json-schema": "1.18.5-alpha",
"monaco-editor": "^0.47.0",
"monaco-yaml": "^5.1.1",
"types-pac": "^1.0.2",
"nanoid": "^5.0.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@ -51,10 +50,15 @@
"react-virtuoso": "^4.7.10",
"recoil": "^0.7.7",
"swr": "^1.3.0",
"tar": "^6.2.1"
"tar": "^6.2.1",
"types-pac": "^1.0.2"
},
"devDependencies": {
"@actions/github": "^5.1.1",
"@babel/preset-env": "^7.24.6",
"@babel/preset-react": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@rollup/plugin-babel": "^6.0.4",
"@tauri-apps/cli": "^1.5.13",
"@types/fs-extra": "^9.0.13",
"@types/js-cookie": "^3.0.6",
@ -62,7 +66,7 @@
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/react-transition-group": "^4.4.10",
"@vitejs/plugin-react": "^4.2.1",
"@vitejs/plugin-react": "^4.3.0",
"adm-zip": "^0.5.12",
"cross-env": "^7.0.3",
"fs-extra": "^11.2.0",

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,26 @@ import { defineConfig } from "vite";
import path from "path";
import svgr from "vite-plugin-svgr";
import react from "@vitejs/plugin-react";
import { babel } from "@rollup/plugin-babel";
import monacoEditor from "vite-plugin-monaco-editor";
// https://vitejs.dev/config/
export default defineConfig({
root: "src",
server: { port: 3000 },
plugins: [
svgr(),
react(),
{
apply: "build", // apply only for build, not for serve
...babel({
babelHelpers: "bundled",
extensions: [".js", ".jsx", ".ts", ".tsx"],
targets: {
edge: "109", // last version to support Windows 7
safari: "13", // macOS 10.15 Catalina
},
}),
},
monacoEditor({
languageWorkers: ["editorWorkerService", "typescript", "css"],
customWorkers: [