mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-16 12:52:48 +08:00
docs: use local wasm file
This commit is contained in:
@ -64,7 +64,7 @@
|
|||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"echarts-gl": "^2.0.9",
|
"echarts-gl": "^2.0.9",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"esbuild-wasm": "^0.19.12",
|
"esbuild-wasm": "^0.23.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-prettier": "^3.4.1",
|
"eslint-plugin-prettier": "^3.4.1",
|
||||||
"eslint-plugin-vue": "^8.7.1",
|
"eslint-plugin-vue": "^8.7.1",
|
||||||
|
@ -16,6 +16,7 @@ import javascript from "highlight.js/lib/languages/javascript";
|
|||||||
import typescript from "highlight.js/lib/languages/typescript";
|
import typescript from "highlight.js/lib/languages/typescript";
|
||||||
import hljsVuePlugin from "@highlightjs/vue-plugin";
|
import hljsVuePlugin from "@highlightjs/vue-plugin";
|
||||||
import { initialize, transform } from "esbuild-wasm";
|
import { initialize, transform } from "esbuild-wasm";
|
||||||
|
import wasmURL from "esbuild-wasm/esbuild.wasm";
|
||||||
import { track } from "@vercel/analytics";
|
import { track } from "@vercel/analytics";
|
||||||
|
|
||||||
import { getImportsFromOption } from "./utils/codegen";
|
import { getImportsFromOption } from "./utils/codegen";
|
||||||
@ -75,9 +76,7 @@ const transformedCode = ref("");
|
|||||||
const transformErrors = ref([]);
|
const transformErrors = ref([]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await initialize({
|
await initialize({ wasmURL });
|
||||||
wasmURL: "https://cdn.jsdelivr.net/npm/esbuild-wasm@0.19.12/esbuild.wasm"
|
|
||||||
});
|
|
||||||
|
|
||||||
initializing.value = false;
|
initializing.value = false;
|
||||||
|
|
||||||
|
@ -20,6 +20,14 @@ export default {
|
|||||||
.test(/\.svg$/)
|
.test(/\.svg$/)
|
||||||
.type("asset/source");
|
.type("asset/source");
|
||||||
|
|
||||||
|
config.module
|
||||||
|
.rule('wasm')
|
||||||
|
.test(/\.wasm$/)
|
||||||
|
.type('asset/resource')
|
||||||
|
.set('generator', {
|
||||||
|
filename: '[name].[hash:8][ext]'
|
||||||
|
})
|
||||||
|
|
||||||
config.plugin("define").tap(([options]) => [
|
config.plugin("define").tap(([options]) => [
|
||||||
{
|
{
|
||||||
...options,
|
...options,
|
||||||
|
Reference in New Issue
Block a user