Skip to content

Commit

Permalink
test netlify server function
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyue737 committed Aug 12, 2024
1 parent 71d1a31 commit 8b015de
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default defineNuxtConfig({
sourcemap: false,
}),
],
build: { sourcemap: false },
build: { minify: false },
},
runtimeConfig: {
github: {
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"eslint": "^9.8.0",
"happy-dom": "^14.12.3",
"nuxt": "^3.12.4",
"nuxt-echarts": "^0.2.1",
"nuxt-echarts": "0.2.1",
"playwright-core": "^1.46.0",
"prettier": "^3.3.3",
"rollup-plugin-regexp": "^5.0.1",
Expand All @@ -39,6 +39,9 @@
"allowedVersions": {
"@typescript-eslint/utils>eslint": "^9.0.0"
}
},
"patchedDependencies": {
"nuxt-echarts": "patches/nuxt-echarts.patch"
}
}
}
12 changes: 12 additions & 0 deletions patches/nuxt-echarts.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/dist/runtime/utils/wc.js b/dist/runtime/utils/wc.js
index 91b8b2e7e40cda93e3c75450128a71cd4e783009..5a53beef4aca42a43530f858104ca20ab0a2105d 100644
--- a/dist/runtime/utils/wc.js
+++ b/dist/runtime/utils/wc.js
@@ -1,6 +1,6 @@
let registered = null;
export const TAG_NAME = "x-vue-echarts";
-if (import.meta.server) {
+if (import.meta.server && global) {
global.HTMLElement = Object;
}
export class EChartsElement extends HTMLElement {
11 changes: 8 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b015de

Please sign in to comment.