Skip to content

Commit

Permalink
feat(canyon-platform): use swc
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang (张涛) committed Oct 24, 2024
1 parent a018727 commit cc8eebb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
12 changes: 6 additions & 6 deletions packages/canyon-platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,16 @@
"tailwind-merge": "^2.5.4"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@graphql-codegen/cli": "^5.0.3",
"@graphql-codegen/client-preset": "^4.4.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"@vitejs/plugin-react": "^4.3.3",
"@vitejs/plugin-react-swc": "^3.7.1",
"autoprefixer": "^10.4.20",
"babel-plugin-canyon": "^1.8.79",
"babel-plugin-istanbul": "^7.0.0",
"@eslint/js": "^9.13.0",
"eslint": "^9.13.0",
"globals": "^15.11.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.1",
Expand All @@ -62,13 +59,16 @@
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.13",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"swc-plugin-canyon": "0.0.2-alpha.25",
"swc-plugin-coverage-instrument": "^0.0.25",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3",
"unplugin-auto-import": "^0.18.3",
"unplugin-auto-import-antd": "^0.0.2",
"vite": "^5.4.10",
"vite-plugin-pages": "^0.32.3"
}
}
}
35 changes: 18 additions & 17 deletions packages/canyon-platform/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
import react from "@vitejs/plugin-react";
import react from "@vitejs/plugin-react-swc";
import * as path from "path";
import AutoImport from "unplugin-auto-import/vite";
import AntdResolver from "unplugin-auto-import-antd";
import { defineConfig } from "vite";
import Pages from "vite-plugin-pages";

const babelConfig = {
plugins:
process.env.NODE_ENV === "development"
? []
: [
"istanbul",
[
"canyon",
{
instrumentCwd: path.resolve(__dirname, "../.."),
},
],
],
};

export default defineConfig({
plugins: [
react({
babel: babelConfig,
plugins:
process.env.NODE_ENV === "development"
? []
: [
["swc-plugin-coverage-instrument", {}],
[
"swc-plugin-canyon",
{
projectID: process.env.CI_PROJECT_ID,
sha: process.env.CI_COMMIT_SHA,
dsn: process.env.DSN,
reporter: process.env.REPORTER,
branch: process.env.CI_COMMIT_BRANCH,
instrumentCwd: path.resolve(__dirname, "../.."),
},
],
],
}),
AutoImport({
imports: ["react", "react-i18next", "react-router-dom"],
Expand Down

0 comments on commit cc8eebb

Please sign in to comment.